Skip to content

Command Injection

Description

The software constructs an OS command using externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command.

Examples

Insecure Code

c
system(user_input);

Secure Code

c
system("ls -l");

Remediation

Validate and sanitize all input used to construct OS commands. Consider using a whitelist approach to only allow expected input.

Rule Details

FieldValue
IDCODE-0677
CategoryInjection
SeverityCRITICAL
CWECWE-88
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagscommand injection, os command
OWASPN/A

References