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

Function checkCommandSubstitution

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

Source from the content-addressed store, hash-verified

275}
276
277func checkCommandSubstitution(command string) []SecurityFinding {
278 target := ExtractQuotedContent(command).WithDoubleQuotes
279 var findings []SecurityFinding
280 for _, item := range commandSubstitutionPatterns {
281 if match := item.re.FindString(target); match != "" {
282 findings = append(findings, SecurityFinding{
283 ID: CheckDangerousPatternsCommandSubstitution,
284 Description: item.description + ": matched '" + match + "'",
285 })
286 }
287 }
288 return findings
289}
290
291func checkZshDangerous(command string) []SecurityFinding {
292 target := ExtractQuotedContent(command).FullyUnquoted

Callers 1

RunAllSecurityChecksFunction · 0.85

Calls 1

ExtractQuotedContentFunction · 0.85

Tested by

no test coverage detected