CWE-91: XML Injection (aka Blind XPath Injection)
The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.
Last updated
Overview
Within XML, special elements could include reserved words or characters such as " ", """, and "&", which could then be used to add new data or modify XML syntax.
Real-world CVEs
74 recorded CVEs are caused by CWE-91 (XML Injection (aka Blind XPath Injection)), including 1 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 22 new CWE-91 CVEs have been recorded so far in 2026 (11 in 2025).
- CVE-2020-0646CISA KEVCritical · CVSS 9.3 · EPSS 100th2020-01-14
- CVE-2021-4140Critical · CVSS 10.0 · EPSS 69th2022-12-22
- CVE-2025-66034
fontTools is Vulnerable to Arbitrary File Write and XML injection in fontTools.varLib
Critical · CVSS 9.8 · EPSS 44th2025-11-29 - CVE-2024-51136Critical · CVSS 9.8 · EPSS 66th2024-11-04
- CVE-2021-36020Critical · CVSS 9.8 · EPSS 85th2021-09-01
- CVE-2020-8479Critical · CVSS 9.8 · EPSS 81th2020-04-29
- CVE-2021-36028Critical · CVSS 9.3 · EPSS 86th2021-09-01
- CVE-2019-17626Critical · CVSS 9.3 · EPSS 95th2019-10-16
- CVE-2024-47113Critical · CVSS 9.1 · EPSS 46th2025-01-18
- CVE-2024-25413Critical · CVSS 9.1 · EPSS 72th2024-02-16
- CVE-2022-32755Critical · CVSS 9.1 · EPSS 51th2023-10-14
- CVE-2022-34253Critical · CVSS 9.1 · EPSS 91th2022-08-16
Showing 12 of 74 recorded CWE-91 CVEs. Track new ones as they are published and get AI-written analysis and fixes.
Monitor CWE-91 vulnerabilitiesCommon consequences
What can happen when CWE-91 is exploited.
Execute Unauthorized Code or Commands, Read Application Data, Modify Application Data
Affects: Confidentiality, Integrity, Availability
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to prevent it
Practical mitigations for CWE-91, grouped by where in the lifecycle they apply.
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, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Terminology & mappings
Mapped taxonomies
- PLOVER: XML injection (aka Blind Xpath injection)
- OWASP Top Ten 2007: Injection Flaws (A2) — CWE More Specific fit
- OWASP Top Ten 2004: Injection Flaws (A6) — CWE More Specific fit
- WASC: XML Injection (23)
- Software Fault Patterns: Tainted input to command (SFP24)
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-91.
- What is CWE-91?
- The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.
- What CVEs are caused by CWE-91?
- 74 recorded CVEs are attributed to CWE-91, including CVE-2020-0646, CVE-2021-4140, CVE-2025-66034. 1 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- Is CWE-91 part of the OWASP Top 10?
- CWE-91 maps to OWASP Top Ten 2007: Injection Flaws (A2) in the OWASP security taxonomy.
- How do you prevent CWE-91?
- 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.
- How is CWE-91 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-91?
- Exploiting CWE-91 can lead to: Execute Unauthorized Code or Commands, Read Application Data, Modify Application Data.
- Is CWE-91 actively exploited?
- Yes. 1 CWE-91 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 74 recorded CVEs.
References
- MITRE CWE definition (CWE-91) (opens in a new tab)
- CWE-91 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-91
Get alerted the moment a new CWE-91 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.