CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

ClassIncompleteExploit Likelihood: High

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple
Vulnerability Mapping
DISCOURAGED

Applicable To

Languages
Not Language-Specific
Platforms

Source-backed guidance

Additional facts reviewed against primary or authoritative security sources.

Combine analysis methods around the CWE-74 resource boundary

MITRE identifies automated static analysis, manual source review, dynamic analysis, fuzzing as applicable detection approaches. Use them to trace untrusted data into every downstream interpreter and require either a structured parameterized interface or context-specific neutralization at the final sink. Require a reproducible trace from attacker influence to the unsafe behavior, record coverage gaps, and confirm suspected findings dynamically where safe; no single technique establishes complete coverage.

CWE-74: detection methods and operational guidanceMITRE CWE

Keep downstream instructions separate from untrusted data

Use an API that avoids the downstream interpreter or provides a parameterized interface so data cannot become commands or queries. Apply positive server-side validation to unavoidable dynamic choices and interpreter-specific output handling to residual values. Do not assume general input validation or a framework prevents injection when application code still concatenates untrusted data into executable syntax.

A05:2025 InjectionOWASP Foundation

Apply lessons from CVE-2023-22527 in Atlassian Confluence Data Center and Server

NVD maps CVE-2023-22527 to CWE-74; an unauthenticated OGNL template-injection flaw could lead to remote code execution. Use the case to identify expression-language evaluation in public endpoints, disable unnecessary evaluation features, and test template parameters as executable input rather than ordinary strings.

CVE-2023-22527 DetailNIST National Vulnerability Database

Map generic injection paths to CAPEC-242

Use CAPEC-242 to connect generic injection findings with the attacker workflow of supplying code that a downstream component evaluates. Record the exact interpreter, grammar, privilege, and execution context for each sink. Then replace string construction with a structured API and verify the resulting data cannot alter control flow or create a second-stage interpreter.

CAPEC-242: Code InjectionMITRE CAPEC

Probe interpreter boundaries with command-injection test cases

Inventory SQL, shell, template, expression, query, header, log, and configuration interpreters. For each sink, vary delimiters, encodings, quoting, nesting, metacharacters, and malformed sequences while observing the actual downstream command or parse tree. Confirm structured APIs keep data separate from instructions and add regression cases for every accepted bypass.

Testing for Command InjectionOWASP Foundation

Frequently Asked Questions

What is CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')?+

CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

What are the security consequences of Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')?+

If exploited, CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) it can compromise Confidentiality, Access Control, Other, Integrity and Non-Repudiation, leading to outcomes such as Read Application Data, Bypass Protection Mechanism, Alter Execution Logic, Other and Hide Activities.

How do you prevent or mitigate Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')?+

Recommended mitigations for CWE-74 include: Programming languages and supporting technologies might be chosen which are not subject to these issues. Utilize an appropriate mix of allowlist and denylist parsing to filter control-plane syntax from all input.

Which programming languages are affected by Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')?+

CWE-74 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')?+

MITRE documents real CVEs mapped to CWE-74, including CVE-2024-5184, CVE-2022-36069, CVE-1999-0067, CVE-2022-1509 and CVE-2020-9054. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-74 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More

Advertisement