High severityRubyInjectionHIGH confidence
OS Command Injection Tainted Input
Untrusted input flows into an OS command executed via a shell (system/exec/Open3/backticks), enabling OS command injection (CWE-78).
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
system(params[:cmd])Passes - the safe pattern
system("ls", "-la")Why it matters & how to fix it
Untrusted input flows into an OS command executed via a shell (system/exec/Open3/backticks), enabling OS command injection (CWE-78). Pass the command and its arguments as a separate argv array (system("cmd", arg1, arg2)) so no shell parsing occurs, and never interpolate request data into the command string.
References
Rule ID integsec-ruby-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 - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation