Cyber Risks · PortSwigger Research

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