High severityJavaInjectionHIGH confidence
OS Command Concatenation
An OS command string is built by concatenating a runtime value (CWE-78/CWE-77).
Standards mapping
Vulnerable vs. safe
Flagged by this check
Runtime.getRuntime().exec("ping " + target);Passes - the safe pattern
new ProcessBuilder("ping", target).start();Why it matters & how to fix it
An OS command string is built by concatenating a runtime value (CWE-78/CWE-77). Invoking a shell ('sh -c', 'cmd /c') with concatenated input allows command injection. Use ProcessBuilder with a fixed argument array and pass user data as separate, validated arguments.
References
Rule ID integsec-java-os-command-concat - 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