Medium severityJavaScript / TypeScriptOther Security ChecksMEDIUM confidence
Child Process Shell True
spawn/execFile is invoked with shell:true, which reintroduces shell metacharacter interpretation and command-injection risk.
Standards mapping
- CWE
- CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.8 (L1)
Vulnerable vs. safe
Flagged by this check
cp.spawn("ls", args, { shell: true });Passes - the safe pattern
cp.spawn("ls", args, { shell: false });Why it matters & how to fix it
spawn/execFile is invoked with shell:true, which reintroduces shell metacharacter interpretation and command-injection risk. Set shell:false (the default) and pass arguments as an array.
References
Rule ID integsec-js-child-process-shell-true - 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 - Other Security ChecksOpen Redirect Tainted Input
- Python - Other Security ChecksDjango Mark Safe
- Python - Other Security ChecksFlask Debug Enabled
- Python - Other Security ChecksFlask Render Template String
- Python - Other Security ChecksInsecure Tempfile Mktemp
- Python - Other Security ChecksJinja2 Autoescape Off