Description
The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
Modes of Introduction:
– Architecture and Design
Likelihood of Exploit: High
Related Weaknesses
Consequences
Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands
If a malicious user injects a character (such as a semi-colon) that delimits the end of one command and the beginning of another, it may be possible to then insert an entirely new and unrelated command that was not intended to be executed.
Potential Mitigations
Phase: Architecture and Design
Effectiveness:
Description:
If at all possible, use library calls rather than external processes to recreate the desired functionality.
Phase: Implementation
Effectiveness:
Description:
If possible, ensure that all external commands called from the program are statically created.
Phase: Implementation
Effectiveness:
Description:
Phase: Operation
Effectiveness:
Description:
Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
Phase: System Configuration
Effectiveness:
Description:
Assign permissions to the software system that prevents the user from accessing/opening privileged files.
CVE References
- CVE-1999-0067
- Canonical example of OS command injection. CGI program does not neutralize “|” metacharacter when invoking a phonebook program.
- CVE-2019-12921
- image program allows injection of commands in “Magick Vector Graphics (MVG)” language.
- CVE-2020-11698
- anti-spam product allows injection of SNMP commands into confiuration file
More Stories
The Most Dangerous Vulnerabilities in Apache Tomcat and How to Protect Against Them
Apache Tomcat is an open-source web server and servlet container that is widely used in enterprise environments to run Java...
ZDI-CAN-18333: A Critical Zero-Day Vulnerability in Microsoft Windows
Zero-day vulnerabilities are a serious threat to cybersecurity, as they can be exploited by malicious actors to gain unauthorized access...
CWE-669 – Incorrect Resource Transfer Between Spheres
Description The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere,...
CWE-67 – Improper Handling of Windows Device Names
Description The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a...
CWE-670 – Always-Incorrect Control Flow Implementation
Description The code contains a control flow path that does not reflect the algorithm that the path is intended to...
CWE-671 – Lack of Administrator Control over Security
Description The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect...