MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / checkZshDangerous

Function checkZshDangerous

tools/bash/security.go:291–307  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

289}
290
291func checkZshDangerous(command string) []SecurityFinding {
292 target := ExtractQuotedContent(command).FullyUnquoted
293 var findings []SecurityFinding
294 for _, token := range strings.Fields(target) {
295 base := token
296 if idx := strings.LastIndex(base, "/"); idx >= 0 {
297 base = base[idx+1:]
298 }
299 if zshDangerousCommands[base] {
300 findings = append(findings, SecurityFinding{
301 ID: CheckZshDangerousCommands,
302 Description: "Zsh dangerous command: " + base,
303 })
304 }
305 }
306 return findings
307}
308
309func checkShellMetacharacters(command string) []SecurityFinding {
310 target := ExtractQuotedContent(command).FullyUnquoted

Callers 1

RunAllSecurityChecksFunction · 0.85

Calls 1

ExtractQuotedContentFunction · 0.85

Tested by

no test coverage detected