Function: containsCommandInjection()
containsCommandInjection(Defined in: validators.ts:311 Detect shell command-injection patterns: command substitution (input):ThreatFinding[]
$(...), backticks), chained dangerous commands (; rm, ; curl,
…) and shell-piped exec (| sh, | bash).
Off by default in detectThreatPatterns — these patterns
occasionally fire on legitimate user content. Enable explicitly
(checkCommandInjection: true) only when input flows into a child
process or shell.
Parameters
input
string
String to scan. Truncated at 100 000 characters.
Returns
ThreatFinding[]
Empty array, or one finding of type "command_injection".