High severityPHPInjectionHIGH confidence
Code Injection Eval
Untrusted input flows into a dynamic code-evaluation primitive (eval/assert/create_function), enabling arbitrary PHP code execution (CWE-94).
Standards mapping
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.6 (L1)
Vulnerable vs. safe
Flagged by this check
eval($code);Passes - the safe pattern
eval("return 2 + 2;");Why it matters & how to fix it
Untrusted input flows into a dynamic code-evaluation primitive (eval/assert/create_function), enabling arbitrary PHP code execution (CWE-94). Never evaluate request data as code. Use an explicit allow-list dispatch table, and replace create_function() with a closure.
References
Rule ID integsec-php-code-injection-eval - 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