vetkit.csharp.command-injection.shell-wrapper
A shell (cmd.exe /c, powershell -Command, sh -c) is started with a command line built from non-constant values. Shell metacharacters in any of those values run arbitrary commands.
Last updated:
Suite: Security
csharp
A shell (cmd.exe /c, powershell -Command, sh -c) is started with a command line built from non-constant values. Shell metacharacters in any of those values run arbitrary commands.
Category: SECURITY · Engine rule severity: ERROR
How to fix it
Invoke the target program directly with ProcessStartInfo.ArgumentList instead of going through a shell, and validate every value against an allow-list.
References
Source: packages/engine/rules/sast/csharp.yml.
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.