Lab: Exploiting XInclude to retrieve files
Summary: PortSwigger's lab presents a "Check stock" feature that embeds user input inside a server-side XML document that is then parsed. Because the attacker does not control the whole document and cannot define a DTD for a classic XXE attack, the lab requires injecting an XInclude statement to retrieve /etc/passwd, with an extra attribute added because XInclude parses the included document as XML by default and /etc/passwd is not valid XML.
Key Takeaway: The lesson for a security leader is that blocking DTDs does not close XML parsing risk: an attacker who controls only a fragment of the document can still pull local files such as /etc/passwd through XInclude.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026