CWE-611: Improper Restriction of XML External Entity Reference
Also known as: XXE
The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
Last updated
Overview
CWE-611 (Improper Restriction of XML External Entity Reference) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Background
XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
Real-world CVEs
593 recorded CVEs are caused by CWE-611 (Improper Restriction of XML External Entity Reference), including 8 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 93 new CWE-611 CVEs have been recorded so far in 2026 (110 in 2025).
- CVE-2025-2775CISA KEV
SysAid On-Prem <= 23.3.40 Checkin Proceessing XML External Entity Injection
Critical · CVSS 9.3 · EPSS 99th2025-05-07 - CVE-2024-34102CISA KEV
XXE can expose crypt key and other secrets granting full admin access
Critical · CVSS 9.3 · EPSS 100th2024-06-13 - CVE-2019-9670CISA KEVCritical · CVSS 9.3 · EPSS 100th2019-05-29
- CVE-2025-58360CISA KEV
GeoServer is vulnerable to an Unauthenticated XML External Entities (XXE) attack via WMS GetMap feature
High · CVSS 8.8 · EPSS 99th2025-11-25 - CVE-2023-45727CISA KEVHigh · CVSS 8.7 · EPSS 88th2023-10-18
- CVE-2019-13608CISA KEVHigh · CVSS 8.7 · EPSS 98th2019-08-29
- CVE-2025-2776CISA KEV
SysAid On-Prem <= 23.3.40 serverurl Proceessing XML External Entity Injection
High · CVSS 7.7 · EPSS 99th2025-05-07 - CVE-2016-9563CISA KEVHigh · CVSS 7.1 · EPSS 98th2016-11-23
- CVE-2025-66516
Apache Tika core, Apache Tika parsers, Apache Tika PDF parser module: Update to CVE-2025-54988 to expand scope of artifacts affected
Critical · CVSS 10.0 · EPSS 100th2025-12-04 - CVE-2023-38693Critical · CVSS 10.0 · EPSS 54th2025-03-05
- CVE-2022-22486Critical · CVSS 10.0 · EPSS 70th2023-02-02
- CVE-2025-30220
GeoTools, GeoServer, and GeoNetwork XML External Entity (XXE) Processing Vulnerability in XSD schema handling
Critical · CVSS 9.9 · EPSS 99th2025-06-10
Showing 12 of 593 recorded CWE-611 CVEs. Track new ones as they are published and get AI-written analysis and fixes.
Monitor CWE-611 vulnerabilitiesCommon consequences
What can happen when CWE-611 is exploited.
Read Application Data, Read Files or Directories
Affects: Confidentiality
If the attacker is able to include a crafted DTD and a default entity resolver is enabled, the attacker may be able to access arbitrary files on the system. By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as "file:///c:/winnt/win.ini" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g., in an error message), thereby exposing the file contents.
Bypass Protection Mechanism
Affects: Integrity
An attacker may supply a crafted DTD using URIs with schemes such as http://, forcing the application to make outgoing HTTP requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions; hide the source of attacks such as port scanning; or otherwise leverage the server's trust relationship with other entities.
DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
Affects: Availability
The product could consume excessive CPU cycles or memory using a URI that points to a large file, or a device that always returns data such as /dev/random. Alternately, the URI could reference a file that contains many nested or recursive entity references to further slow down parsing.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
Technologies
How to prevent it
Practical mitigations for CWE-611, grouped by where in the lifecycle they apply.
Many XML parsers and validators can be configured to disable external entity expansion.
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
Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2022-42745 — Recruiter software allows reading arbitrary files using XXE
- CVE-2005-1306 — A browser control can allow remote attackers to determine the existence of files via Javascript containing XML script.
- CVE-2012-5656 — XXE during SVG image conversion
- CVE-2012-2239 — XXE in PHP application allows reading the application's configuration file.
- CVE-2012-3489 — XXE in database server
- CVE-2012-4399 — XXE in rapid web application development framework allows reading arbitrary files.
- CVE-2012-3363 — XXE via XML-RPC request.
- CVE-2012-0037 — XXE in office document product using RDF.
- CVE-2011-4107 — XXE in web-based administration tool for database.
- CVE-2010-3322 — XXE in product that performs large-scale data analysis.
- CVE-2009-1699 — XXE in XSL stylesheet functionality in a common library used by some web browsers.
Terminology & mappings
Alternate terms
- XXE
- An acronym used for the term "XML eXternal Entities"
Mapped taxonomies
- WASC: XML External Entities (43)
- Software Fault Patterns: Tainted input to command (SFP24)
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-611.
- What is CWE-611?
- The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
- What CVEs are caused by CWE-611?
- 593 recorded CVEs are attributed to CWE-611, including CVE-2025-2775, CVE-2024-34102, CVE-2019-9670. 8 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-611?
- Many XML parsers and validators can be configured to disable external entity expansion.
- How is CWE-611 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-611?
- Exploiting CWE-611 can lead to: Read Application Data, Read Files or Directories, Bypass Protection Mechanism, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory).
- Is CWE-611 actively exploited?
- Yes. 8 CWE-611 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 593 recorded CVEs.
References
- MITRE CWE definition (CWE-611) (opens in a new tab)
- CWE-611 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-611
Get alerted the moment a new CWE-611 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.