Skip to content

OSWA · Module 10

XML External Entities

Discover and exploit XXE to read local files, pivot to SSRF, and exfiltrate data out-of-band through vulnerable XML parsers.

~1.5 h 2 resources Last updated September 26, 2026

XML External Entity (XXE) injection abuses XML parsers that resolve external entities. When an application accepts XML input and its parser is configured to process DTDs and external entities, an attacker can read local files, trigger server-side requests (SSRF), and exfiltrate data out-of-band. XXE hides in obvious XML endpoints and in less obvious places like SOAP services, SVG uploads, and document formats (DOCX, XLSX) that are XML under the hood.

XXE Discovery

Finding XXE starts with identifying endpoints that accept XML, then testing whether the parser expands entities. Internal entity expansion confirms the parser processes DTDs; an external file-read entity confirms exploitability. When no output is returned, a blind test using an out-of-band callback proves the vulnerability. SVG and file-upload paths are common XXE vectors worth testing explicitly.

XXE Exploitation

Exploitation reads server files in-band, pivots to SSRF by pointing an entity at internal services or cloud metadata, and handles blind cases with out-of-band exfiltration through an external DTD. CDATA wrapping enables reading files that would otherwise break XML parsing, and error-based XXE leaks file contents inside parser error messages when other channels are closed.

Read

The core material for this module. Where a guide goes deeper than needed, the relevant sections are highlighted.

Practice

Apply the module hands-on.

All OSWA practice machines