Join our Newsletter — 33% off our NHI Course

XML External Entities (XXE)

An XXE attack abuses XML parser behaviour so external references are resolved from untrusted input. The attacker can sometimes read files, trigger internal requests, or force resource exhaustion, depending on how the parser and the surrounding service are configured.

Expanded Definition

XML External Entities, or XXE, is a parser-level vulnerability class that appears when XML input is accepted without disabling external entity resolution, DTD processing, or related parser features. The risk is not the XML format itself, but the way a service interprets untrusted XML while allowing references that point outside the document boundary. That can expose local files, internal network paths, or backend resources, and in some implementations it can also amplify denial-of-service conditions through entity expansion.

In security terms, XXE sits at the intersection of input handling, parser configuration, and network trust boundaries. It is often discussed alongside other injection-style flaws, but it is distinct because the attacker is influencing how the parser resolves references rather than inserting executable code. For a governance lens, the NIST Cybersecurity Framework 2.0 is a useful reference point for reducing exposure through secure software practices, configuration management, and resilient system design. Usage in the industry is still evolving in environments that have shifted from XML-heavy integrations to mixed JSON and API workflows, which can make inherited XML parsers easy to overlook.

The most common misapplication is assuming XML is safe by default, which occurs when developers accept untrusted payloads but leave external entity resolution enabled in production parsers.

Examples and Use Cases

Implementing XML parsing rigorously often introduces compatibility and configuration constraints, requiring organisations to weigh interoperability with legacy systems against the security benefit of disabling risky parser features.

  • A customer-facing SOAP endpoint accepts XML requests from third parties, and an attacker submits a payload that attempts to resolve a local file path through an external entity.
  • An internal document-processing service parses uploaded XML invoices, but a misconfigured parser follows a remote entity reference and makes an outbound request to an attacker-controlled host.
  • A file conversion pipeline expands nested entities during import, causing excessive memory use and service slowdown when a crafted document is submitted.
  • A security test confirms that a parser rejects DTDs and external entities by default, aligning the application with secure-by-design handling recommended in OWASP guidance on XXE.
  • A legacy integration must continue supporting XML, so teams constrain the parser, validate input structure, and segment the service to reduce the blast radius of any successful exploit.

XXE is most likely to surface in services that were built for older enterprise integration patterns, especially where XML is exchanged between trust zones or transformed by middleware before reaching business logic. It also appears in vendor products that expose XML-based management interfaces, where secure defaults depend on the implementer rather than the format itself.

Why It Matters for Security Teams

Security teams need to understand XXE because it can turn a routine parser setting into a high-impact breach path. A successful attack may expose secrets, internal service metadata, or sensitive documents, and it can also create hidden server-side request activity that complicates detection and incident response. The issue is especially important in environments that still process XML in authentication, messaging, file import, or control-plane workflows, because the exploit often begins as ordinary application traffic.

For defenders, the practical response is to harden parsers, reject unnecessary DTD processing, validate trusted XML use cases, and monitor for unexpected outbound requests from application services. The relationship to the broader OWASP Top Ten is useful because XXE is part of the same secure coding discipline that prevents input-driven compromise, even though the exact classification may vary across platforms and testing tools. Teams should also treat parser configuration as a security control, not a developer convenience, because defaults differ widely across languages and frameworks.

Organisations typically encounter the operational cost of XXE only after a penetration test, incident review, or unexpected outbound connection reveals that XML parsing was never properly constrained, at which point the control gap becomes operationally unavoidable to address.

Standards & Framework Alignment

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

NIST CSF 2.0 provides the primary governance reference for this term.

Framework Control / Reference Relevance
NIST CSF 2.0 PR.IP-1 Secure configuration of software and systems is central to preventing XXE parser abuse.

Disable risky XML parser features and manage parser settings as part of secure configuration baselines.