High severityPHPInjectionHIGH confidence
OS Command Injection
Untrusted request input flows into an OS command executed by the shell, enabling OS command injection (CWE-78/CWE-77).
Standards mapping
Vulnerable vs. safe
Flagged by this check
system("ping -c 1 " . $host);Passes - the safe pattern
system("ping -c 1 " . escapeshellarg($host));Why it matters & how to fix it
Untrusted request input flows into an OS command executed by the shell, enabling OS command injection (CWE-78/CWE-77). Never pass user input to exec/system/shell_exec/passthru/popen/proc_open. If an external command is unavoidable, pass a fixed argument list and escape every argument with escapeshellarg(); escapeshellcmd() alone is not sufficient.
References
Rule ID integsec-php-os-command-injection - 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