CWE-77: Improper Neutralization of Special Elements used in a Command
3238 CVEs have CWE-77 as their primary weakness. 36 of them are in the CISA KEV catalog. The highest EPSS score among them is 99.999%.
The product 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.
Many protocols and products have their own custom command language. While OS or shell command strings are frequently discovered and targeted, developers may not realize that these other command languages might also be vulnerable to attacks.
Child of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component
Mitigations
- Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
- Implementation: If possible, ensure that all external commands called from the program are statically created.
- Implementation: Assume all input is malicious. Use an accept known good input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, boat may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as red or blue. Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However,…
- Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
- System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.
Observed examples
- CVE-2026-27806: Device management product allows injection of Tcl/expect commands
- CVE-2022-1509: injection of sed script syntax (sed injection)
- CVE-2024-5184: ML-based email analysis product uses an API service that allows a malicious user to inject a direct prompt and take over the service logic, forcing it to leak the standard hard-coded system prompts and/or execute unwanted prompts to leak sensitive data.
- CVE-2020-11698: anti-spam product allows injection of SNMP commands into configuration file
- CVE-2019-12921: image program allows injection of commands in Magick Vector Graphics (MVG) language.
- CVE-2022-36069: Python-based dependency management tool avoids OS command injection when generating Git commands but allows injection of optional arguments with input beginning with a dash (CWE-88), potentially allowing for code execution.
- CVE-1999-0067: Canonical example of OS command injection. CGI program does not neutralize | metacharacter when invoking a phonebook program.
- CVE-2020-9054: Chain: improper input validation (CWE-20) in username parameter, leading to OS command injection (CWE-78), as exploited in the wild per CISA KEV.
- CVE-2021-41282: injection of sed script syntax (sed injection)
- CVE-2019-13398: injection of sed script syntax (sed injection)
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2024-3400 | 2024-04-12 | CRITICAL | 10.0 | 99.999% | A command injection as a result of arbitrary file creation vulnerability in the GlobalProtect feature of Palo Alto Networks PAN-OS software for specific PAN-OS… |
| CVE-2023-1671 | 2023-04-04 | CRITICAL | 9.8 | 99.999% | A pre-auth command injection vulnerability in the warn-proceed handler of Sophos Web Appliance older than version 4.3.10.4 allows execution of arbitrary code. |
| CVE-2024-21887 | 2024-01-12 | CRITICAL | 9.1 | 99.999% | A command injection vulnerability in web components of Ivanti Connect Secure (9.x, 22.x) and Ivanti Policy Secure (9.x, 22.x) allows an authenticated… |
| CVE-2023-1389 | 2023-03-15 | HIGH | 8.8 | 99.999% | TP-Link Archer AX21 (AX1800) firmware versions before 1.1.4 Build 20230219 contained a command injection vulnerability in the country form of the… |
| CVE-2012-1823 | 2012-05-11 | CRITICAL | 9.8 | 99.998% | sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that… |
| CVE-2024-3273 | 2024-04-04 | HIGH | 7.3 | 99.995% | ** UNSUPPORTED WHEN ASSIGNED ** A vulnerability, which was classified as critical, was found in D-Link DNS-320L, DNS-325, DNS-327L and DNS-340L up to 20240403.… |
| CVE-2025-10035 | 2025-09-18 | CRITICAL | 10.0 | 99.823% | A deserialization vulnerability in the License Servlet of Fortra's GoAnywhere MFT allows an actor with a validly forged license response signature to… |
| CVE-2026-8037 | 2026-06-04 | CRITICAL | 9.6 | 99.794% | OS Command Injection Remote Code Execution Vulnerability in API in Progress ADC Products allows an un-authenticated attacker to execute arbitrary commands on… |
| CVE-2016-1555 | 2017-04-21 | CRITICAL | 9.8 | 98.325% | (1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear WN604 before 3.3.3 and WN802Tv2… |
| CVE-2023-20887 | 2023-06-07 | CRITICAL | 9.8 | 98.281% | Aria Operations for Networks contains a command injection vulnerability. A malicious actor with network access to VMware Aria Operations for Networks may be… |
| CVE-2007-3010 | 2007-09-18 | CRITICAL | 9.8 | 97.385% | masterCGI in the Unified Maintenance Tool in Alcatel OmniPCX Enterprise Communication Server R7.1 and earlier allows remote attackers to execute arbitrary… |
| CVE-2015-2051 | 2015-02-23 | HIGH | 8.8 | 97.101% | The D-Link DIR-645 Wired/Wireless Router Rev. Ax with firmware 1.04b12 and earlier allows remote attackers to execute arbitrary commands via a… |
| CVE-2016-3081 | 2016-04-26 | HIGH | 8.1 | 96.916% | Apache Struts 2.3.19 to 2.3.20.2, 2.3.21 to 2.3.24.1, and 2.3.25 to 2.3.28, when Dynamic Method Invocation is enabled, allow remote attackers to execute… |
| CVE-2024-55956 | 2024-12-13 | CRITICAL | 9.8 | 93.968% | In Cleo Harmony before 5.8.0.24, VLTrader before 5.8.0.24, and LexiCom before 5.8.0.24, an unauthenticated user can import and execute arbitrary Bash or… |
| CVE-2025-4008 | 2025-05-21 | HIGH | 8.8 | 93.526% | The Meteobridge web interface let meteobridge administrator manage their weather station data collection and administer their meteobridge system through a web… |
| CVE-2026-42271 | 2026-05-08 | HIGH | 8.8 | 91.445% | LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. From version 1.74.2 to before version 1.83.7, two endpoints used to… |
| CVE-2025-29635 | 2025-03-25 | HIGH | 7.2 | 87.944% | A command injection vulnerability in D-Link DIR-823X 240126 and 240802 allows an authorized attacker to execute arbitrary commands on remote devices by sending… |
| CVE-2024-12356 | 2024-12-17 | CRITICAL | 9.8 | 87.432% | A critical vulnerability has been discovered in Privileged Remote Access (PRA) and Remote Support (RS) products which can allow an unauthenticated attacker to… |
| CVE-2005-2773 | 2005-09-02 | CRITICAL | 9.8 | 74.419% | HP OpenView Network Node Manager 6.2 through 7.50 allows remote attackers to execute arbitrary commands via shell metacharacters in the (1) node parameter to… |
| CVE-2016-20017 | 2022-10-19 | CRITICAL | 9.8 | 65.777% | D-Link DSL-2750B devices before 1.05 allow remote unauthenticated command injection via the login.cgi cli parameter, as exploited in the wild in 2016 through… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-77'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-77'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).