High severityC#InjectionHIGH confidence
OS Command Concatenation
An OS command or its arguments are built by concatenating/interpolating a runtime value (CWE-78/CWE-77).
Standards mapping
Vulnerable vs. safe
Flagged by this check
Process.Start("cmd.exe", "/c echo " + user);Passes - the safe pattern
Process.Start("cmd.exe", "/c echo hello");Why it matters & how to fix it
An OS command or its arguments are built by concatenating/interpolating a runtime value (CWE-78/CWE-77). Shelling out with user-influenced strings allows command injection. Invoke a fixed program and add each argument to ProcessStartInfo.ArgumentList so the OS receives them as discrete, un-parsed tokens.
References
Rule ID integsec.csharp.injection.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