High severityJavaScript / TypeScriptInjectionHIGH confidence
OS Command Injection Tainted Input
Untrusted request data flows into an OS command execution sink, enabling command injection.
Standards mapping
Vulnerable vs. safe
Flagged by this check
cp.exec("ls " + req.body.dir);Passes - the safe pattern
cp.execFile("ls", [req.body.dir]);Why it matters & how to fix it
Untrusted request data flows into an OS command execution sink, enabling command injection. Avoid the shell; use execFile/spawn with an argument array and validate/allowlist inputs.
References
Rule ID integsec-js-os-command-injection-taint - 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 - InjectionSQL Injection String Concatenation
- JavaScript / TypeScript - InjectionSQL Injection Tainted Input