Join our Newsletter — 33% off our NHI Course
Home› Glossary› Threats, Abuse & Incident Response› Extensible Markup Language External Entity (XXE)
Threats, Abuse & Incident Response

Extensible Markup Language External Entity (XXE)

← Back to Glossary
By NHI Mgmt Group Updated November 16, 2026 Domain: Threats, Abuse & Incident Response

Extensible Markup Language External Entity, or XXE, is a security weakness in XML parsers that allow external entities to be resolved. An attacker can use crafted XML to read local files, trigger server-side requests or cause denial of service if entity resolution is not restricted.

What XXE Actually Exploits

XXE is not just “bad XML,” it is a parser behaviour problem. The vulnerability appears when an application accepts XML input and leaves external entity resolution enabled, letting attacker-controlled XML reference local files, remote URLs, or nested entity definitions that expand into excessive parser work. The danger comes from trusted parsing paths being turned into an input-driven access channel.

In practice, XXE matters because XML is often used in integration points that developers consider routine, such as SOAP services, configuration readers, document processors, and legacy APIs. When a parser follows external references automatically, the application may disclose internal data or perform outbound requests on behalf of the server.

Why XXE Becomes Dangerous

XXE can create three broad failure modes. First, it may expose local files or service metadata if the parser can resolve a local entity reference. Second, it can be used for server-side request forgery when the parser reaches out to attacker-chosen locations. Third, entity expansion can consume CPU or memory and slow or crash the service.

The issue is dangerous because the parser often runs inside a trusted network location with access to data and internal services that the attacker cannot reach directly. That makes XXE a bridge from untrusted input to internal resources, which is why the same weakness can produce confidentiality, integrity, and availability impact.

For web-facing systems, XXE often belongs alongside broader XML attack classes and parser misconfiguration patterns. The most useful lens is not “XML is risky,” but “this parser is doing more than it should when it processes untrusted input.”

How Organisations Recognise Exposure

Exposure usually starts with asset inventory and code review. Teams need to identify where XML is accepted, which libraries are in use, and whether the parser is configured to allow DTDs, external entities, or XML features that fetch remote content. Legacy integrations and indirect XML handling are easy to miss because the XML processing may sit inside a framework rather than application code.

External exposure also matters. A public endpoint that parses XML is more likely to be probed for XXE than an internal-only service, especially when error messages, unusual outbound traffic, or file reads hint that entity resolution is still enabled. Vendor guidance and parser documentation are the authoritative sources for exact hardening settings, especially because defaults differ across languages and libraries.

Where you need a broader defensive reference, the XXE Guide and Web Application Attacks Guide cover the attack pattern, while the parser hardening angle aligns closely with the OWASP Top 10 A02 Guide view of security misconfiguration.

Remediation and Defensive Controls

The safest default is to disable external entity resolution and block DTD processing wherever the application does not explicitly require it. If XML must be accepted, treat parser configuration as a security control, not a convenience setting. Prefer hardened parser modes and safe libraries that do not fetch external references by default.

When a patch or code change cannot be deployed immediately, compensating controls should reduce the blast radius. That includes restricting outbound network access from the service, limiting file system reach, filtering untrusted XML at the edge, and removing unnecessary XML features from the affected workflow. These controls do not fix the parser flaw, but they can stop the parser from reaching sensitive targets.

Because XXE is often a configuration issue as much as a code issue, the best match for control hardening is often the configuration baseline. The OWASP Top 10 A02 Guide is useful for thinking about hardened defaults, and the Web Application Attacks Guide provides the wider web attack context in which XXE usually appears.

Detection and Post-Exposure Review

Detection should look for parser errors, unusual outbound requests, unexpected file access attempts, and signs of entity expansion abuse. If XXE was exploited, the organisation should review logs for suspicious XML payloads, probe traffic, and any evidence that the application followed attacker-supplied references.

Post-patch review matters because successful exploitation can leave behind more than just a transient request. If an attacker used XXE to read files or reach internal services, the organisation should assess whether secrets, configuration files, tokens, or credentials were exposed and whether any downstream access paths were opened as a result.

That is why XXE is best treated as both an application weakness and a potential data exposure event. The relevant question after discovery is not only whether the parser is fixed, but whether the application was already used to disclose information or pivot into internal systems before the fix landed.

Risk and Threat Considerations

XXE creates a direct trust-boundary failure because untrusted XML can be converted into file reads, outbound requests, or resource exhaustion. The risk is highest where the parser can reach sensitive local paths, internal services, or networks that are otherwise unreachable from outside.

Failure mechanism: The parser processes attacker-controlled XML with external entities or DTD expansion enabled, allowing the input to drive file disclosure, SSRF-style requests, or denial of service through entity expansion.

Impact: Confidential data, internal service reachability, and service availability can all be affected, and a successful exploitation path may also expose credentials or configuration material that supports follow-on compromise.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV1 — Encoding and SanitizationXXE is an input-handling flaw in XML processing.
V13 — ConfigurationXXE is often prevented by secure parser configuration and disabled external entities.
Recommendation — Harden XML input handling and reject parser features that let untrusted data trigger entity expansion. Disable DTDs and external entity resolution in every XML parser configuration.
CIS Controls v8CIS-16 — Application Software SecurityXXE is a web application weakness that should be prevented in secure development and testing.
Recommendation — Test XML-handling code for XXE paths before release and remediate unsafe parser defaults.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationXXE arises when untrusted XML input is accepted without sufficient validation and restriction.
CM-7 — Least FunctionalityDisabling unnecessary XML features follows least-functionality guidance for risky parser capabilities.
Recommendation — Validate XML inputs and constrain parser behaviour so external entities cannot be resolved. Remove parser capabilities that are not required, including external entity processing.

Practitioner Guidance

Why practitioners should care: XXE is usually prevented by parser settings and secure defaults, which means ownership often sits across development, platform, and security teams rather than only in one codebase. Treat XML parsing choices as part of secure application design, not as a low-level implementation detail.

What to watch for: Any application that accepts XML from users, partners, or upstream systems should be checked for DTD handling, external entity resolution, and unexpected outbound access during parsing. If the parser behaviour is unclear, the safest assumption is that it needs explicit hardening.

Practitioner takeaway: Confirm the parser’s actual runtime settings, not just the intended configuration, because XXE often survives as a hidden default in otherwise well-reviewed applications.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org