High severityRubyInjectionMEDIUM confidence
Code Injection Eval Tainted Input
Untrusted input flows into a dynamic code-evaluation or reflection sink (eval/instance_eval/class_eval/send/constantize), enabling code injection and arbitrary method dispatch (CWE-94/CWE-95).
Standards mapping
Vulnerable vs. safe
Flagged by this check
eval(params[:code])Passes - the safe pattern
eval("1 + 1")Why it matters & how to fix it
Untrusted input flows into a dynamic code-evaluation or reflection sink (eval/instance_eval/class_eval/send/constantize), enabling code injection and arbitrary method dispatch (CWE-94/CWE-95). Never evaluate or resolve request data as code; use an explicit allow-list mapping input to permitted methods/classes.
References
Rule ID integsec-ruby-code-injection-eval-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 - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation