CAPEC-248
Command Injection
An adversary looking to execute a command of their choosing, injects new items into an existing command thus modifying interpretation away from what was intended. Commands in this context are often standalone strings that are interpreted by a downstream component and cause specific responses. This type of attack is possible when untrusted values are used to build these command strings. Weaknesses in input validation or command construction can enable the attack and lead to successful exploitation.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-248: Command Injection: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/248.html and https://cve.bz/cve/capec/248?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
Prerequisites
The target application must accept input from the user and then use this input in the construction of commands to be executed. In virtually all cases, this is some form of string input that is concatenated to a constant string defined by the application to form the full command to be executed.
Consequences
| Impact | Affects | Note |
|---|---|---|
| Execute Unauthorized Commands | Confidentiality, Integrity, Availability | A successful command injection attack enables an adversary to alter the command being executed and achieve a variety of negative consequences depending on the makeup of the new command. This includes potential information disclosure or the corruption of application data. |
Mitigations
All user-controllable input should be validated and filtered for potentially unwanted characters. Using an allowlist for input is desired, but if use of a denylist approach is necessary, then focusing on command related terms and delimiters is necessary.
Input should be encoded prior to use in commands to make sure command related characters are not treated as part of the command. For example, quotation characters may need to be encoded so that the application does not treat the quotation as a delimiter.
Input should be parameterized, or restricted to data sections of a command, thus removing the chance that the input will be treated as part of the command itself.
Weaknesses it exploits
- CWE-77 Improper Neutralization of Special Elements used in a Command
Recent CVEs with these weaknesses
- 8.5CVE-2026-140041
A flaw has been found in WAVLINK WL-WN530BE1-A M30BE1_V251117. The impacted element is the function FUN_0001f94c of the file /protocol.csp of the component ioos. Executing a manipulation of the argument mac can lead to os command injection…
- 8.6CVE-2026-140040
A vulnerability was detected in WAVLINK WL-WN530BE1-A M30BE1_V251117. The affected element is the function port_forward of the file /protocol.csp of the component ioos. Performing a manipulation of the argument Name results in os command i…
- 8.5CVE-2026-138436
A vulnerability was identified in TRENDnet TEW-824DRU 1.00b18. Affected by this issue is some unknown functionality of the file /cgi/ssi. The manipulation of the argument syslog_server leads to os command injection. It is possible to initi…
- 9.3CVE-2026-138417
A vulnerability was determined in Tenda AX9 22.03.01.46. This issue affects the function system of the file /goform/setMacFilterCfg of the component Web Management Backend. Executing a manipulation of the argument macFilterType can lead to…
- 8.6CVE-2026-138416
A vulnerability was found in D-Link R15 1.22.01. This vulnerability affects the function save_CSID_SetDeviceSettings of the file /bin/httpd of the component DHMAPI. Performing a manipulation of the argument TZLocation results in command in…
- 9.4CVE-2026-138392
A vulnerability was found in Tenda CP3 Pro 27.5.52.101. This affects the function CNetApp::OnConfigNetwork of the file /bin/Kylin. The manipulation results in command injection. The attack may be launched remotely.
- 8.6CVE-2026-138358
A vulnerability was identified in D-Link DMS-3130 and DXS-3130 1.20.P006. Affected by this issue is the function http_import_nuclias_manager_profile of the file 464_Nuclias_Manager_Settings.lua of the component Nuclias Manager Profile Impo…
- 8.6CVE-2026-138357
A vulnerability was determined in D-Link DMS-3130 and DXS-3130 1.20.P006. Affected by this vulnerability is an unknown functionality of the file 898_ssl_global.lua of the component SSL Certificate Import Endpoint. This manipulation of the …
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
MITRE's words, unchanged: CAPEC-248 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.