A parser weakness that allows hostile XML to reference local files or remote resources through external entities. In SAML processing, XXE can expose secrets or enable server-side request forgery if DTD processing and entity resolution are not disabled before parsing untrusted responses.
Expanded Definition
XML External Entity Injection, or XXE, is a parser abuse condition in which untrusted XML is allowed to resolve external entities before the application has constrained DTD processing. In NHI and IAM workflows, that matters most when XML carries authentication or federation data, such as SAML assertions, where the parser can be tricked into reading local files or reaching remote URLs.
XXE is not a flaw in XML itself, but in how the parser is configured and where the input is accepted. Definitions vary across vendors on how broadly to classify the issue, yet the core security expectation is consistent: do not permit external entity resolution for untrusted content. Guidance from the NIST Cybersecurity Framework 2.0 aligns with this defensive posture by emphasizing secure configuration and risk reduction across data-processing paths.
The most common misapplication is assuming SAML libraries are safe by default, which occurs when teams trust parser defaults instead of explicitly disabling DTDs and external entity expansion.
Examples and Use Cases
Implementing protection against XXE rigorously often introduces compatibility and testing overhead, requiring organisations to weigh parser hardening against the convenience of accepting legacy XML features.
- Hardening a SAML consumer so hostile assertions cannot trigger file reads or backend requests during XML parsing.
- Disabling DTD processing in an API that accepts XML uploads from partners, then validating with a known-safe parser profile.
- Reviewing an identity broker after incidents like the Hugging Face Spaces breach, where exposed service paths and secrets handling become part of the broader attack surface.
- Using parser allowlists and schema validation in federation services so only expected XML structures are accepted.
- Applying secure-by-default XML libraries and explicit entity suppression in systems that exchange signed identity payloads between trust zones.
For implementation guidance, the OWASP XXE guidance remains a practical reference for identifying unsafe parser settings and validating remediation.
Why It Matters in NHI Security
XXE becomes especially dangerous in NHI workflows because identity assertions, tokens, and configuration files often sit close to highly privileged service accounts. If an attacker can coerce XML parsing into disclosing local files, the result may be secrets exposure, credential replay, or lateral movement through downstream automation. NHIMG research shows that 96% of organisations store secrets outside of secrets managers, which means XXE can turn a single parser mistake into a direct path to usable credentials. That risk compounds when XML is used in trust decisions and the exposed material includes keys, certificates, or session artifacts.
Practitioners should treat XXE as both an application vulnerability and an identity compromise vector, not just a web security issue. The correct response is to disable external entity resolution, constrain parser features, and test every XML ingestion path that touches privileged automation.
Organisations typically encounter the full impact only after logs, secrets, or outbound requests reveal that a parser has already been abused, at which point XXE 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.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | XXE can expose NHI secrets by abusing XML parsing and entity resolution. |
| NIST CSF 2.0 | PR.DS-1 | XXE threatens data confidentiality by leaking files and secrets through parsing flaws. |
| NIST Zero Trust (SP 800-207) | SC-23 | Zero Trust limits implicit trust in parser-originated requests and derived outputs. |
Harden XML parsers and protect sensitive data from disclosure through untrusted input handling.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 24, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org