High severityPythonInjectionHIGH confidence
Shell True Concatenation
A shell command is built by concatenating or formatting a string and run with shell=True (or via os.system/os.popen), enabling OS command injection (CWE-78/CWE-77).
Standards mapping
Vulnerable vs. safe
Flagged by this check
subprocess.call("tar -czf out.tgz " + path, shell=True)Passes - the safe pattern
subprocess.call(["tar", "-czf", "out.tgz", path], shell=False)Why it matters & how to fix it
A shell command is built by concatenating or formatting a string and run with shell=True (or via os.system/os.popen), enabling OS command injection (CWE-78/CWE-77). Pass an argument list with shell=False (the default) instead of a formatted string; if a shell is required, quote each argument with shlex.quote().
References
Rule ID integsec-python-shell-true-concat - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - InjectionCode Injection Tainted Input
- JavaScript / TypeScript - InjectionEval Dynamic Argument
- JavaScript / TypeScript - InjectionNoSQL Query From Request
- JavaScript / TypeScript - InjectionNoSQL Where Operator
- JavaScript / TypeScript - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation