---
title: "CWE-91: XML Injection"
url: https://radicalnotion.ai/cwe/cwe-91
type: cwe
description: "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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-91: XML Injection

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 149
- **Of those, in CISA KEV:** 1
- **New in 2026:** 45
- **CWE catalog version:** 4.21

## Description

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.

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.

## Alternate terms

- Blind XPath Injection

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability | Execute Unauthorized Code or Commands, Read Application Data, Modify Application Data | - |

## Potential mitigations

### Implementation (Input Validation)

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.

## Detection methods

### 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

## Real CVEs with this weakness (sample of 12 of 149)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2020-0646 | .NET Framework Remote Code Execution Injection Vulnerability | critical | 9.3 | - | Yes | 2020-01-14 |
| CVE-2021-4140 | Mozilla: Iframe sandbox bypass with XSLT | critical | 10.0 | - | No | 2022-12-22 |
| CVE-2026-103044 | EasyTimeline should not serve image maps as application/xml | critical | 9.8 | - | No | 2026-09-29 |
| CVE-2025-66034 | fontTools is Vulnerable to Arbitrary File Write and XML injection in fontTools.varLib | critical | 9.8 | - | No | 2025-11-29 |
| CVE-2024-51136 | - | critical | 9.8 | - | No | 2024-11-04 |
| CVE-2023-43187 | - | critical | 9.8 | - | No | 2023-09-26 |
| CVE-2019-19450 | ReportLab vulnerable to remote code execution via paraparser | critical | 9.8 | - | No | 2023-09-20 |
| CVE-2021-36020 | Magento Commerce XML Injection Vulnerability In The 'City' Field Could Lead To Remote Code Execution | critical | 9.8 | - | No | 2021-09-01 |
| CVE-2021-37154 | - | critical | 9.8 | - | No | 2021-08-25 |
| CVE-2020-25216 | - | critical | 9.8 | - | No | 2020-09-17 |
| CVE-2020-8479 | ABB Central Licensing System - XML External Entity Injection | critical | 9.8 | - | No | 2020-04-29 |
| CVE-2020-11535 | - | critical | 9.8 | - | No | 2020-04-15 |

## Related attack patterns (CAPEC)

- [CAPEC-250](https://radicalnotion.ai/capec/capec-250): XML Injection
- [CAPEC-83](https://radicalnotion.ai/capec/capec-83): XPath Injection

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-74](https://radicalnotion.ai/cwe/cwe-74) | Improper Neutralization of Special Elements in Output Used by a Downstream Component |
| Child | [CWE-643](https://radicalnotion.ai/cwe/cwe-643) | Improper Neutralization of Data within XPath Expressions |
| Child | [CWE-652](https://radicalnotion.ai/cwe/cwe-652) | Improper Neutralization of Data within XQuery Expressions |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | XML injection (aka Blind Xpath injection) | - | - |
| OWASP Top Ten 2007 | Injection Flaws | A2 | CWE More Specific |
| OWASP Top Ten 2004 | Injection Flaws | A6 | CWE More Specific |
| WASC | XML Injection | 23 | - |
| Software Fault Patterns | Tainted input to command | SFP24 | - |

## Frequently asked questions

### 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?

149 recorded CVEs are attributed to CWE-91, including CVE-2020-0646, CVE-2021-4140 and CVE-2026-103044. 1 is 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 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 149 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/91.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-91). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
