Detecting Command Injection Patterns

| Scan a source tree for command-injection vulnerable patterns: shell=True calls in Python subprocess, os.system / os.popen with interpolated strings, Node child_process.exec with template literals, Ruby backticks / Kernel#system / Kernel#exec with interpolation, Go exec.Command with shell wrapping, PHP system / passthru / shell_exec / backticks with $-interpolation, Java Runtime.exec with concatenated args. Use when: pre-commit gate on code that calls out to shell utilities, audit of file-processing / archive-handling / image-conversion code, post-bug-report investigation for "we shell out to a tool." Threshold: any shell-invocation API called with a string that contains a variable interpolation, OR shell=True with anything other than a fixed literal. Trigger with: "scan command injection", "shell=True audit", "find exec calls", "check os.system".

thedixitjain b98c5e3 4 files · 27.9 KB Updated 2 repo stars

File contents

thedixitjain/the-mega-skill-library/tree/main/library/engineering-core/detecting-command-injection-patterns commit b98c5e377e

Frequently asked questions

npx skillmds add thedixitjain/detecting-command-injection-patterns