(command string)
| 275 | } |
| 276 | |
| 277 | func 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 | |
| 291 | func checkZshDangerous(command string) []SecurityFinding { |
| 292 | target := ExtractQuotedContent(command).FullyUnquoted |
no test coverage detected