--- url: "https://portswigger.net/web-security/xxe/lab-xinclude-attack" titulek: "Lab: Exploiting XInclude to retrieve files | Web Security Academy" h1: "Lab: Exploiting XInclude to retrieve files" popis: "This lab has a \"Check stock\" feature that embeds the user input inside a server-side XML document that is subsequently parsed. Because you don't control the ..." jazyk: "" kanonicka: "https://portswigger.net/web-security/xxe/lab-xinclude-attack" drobecky: ["Web Security Academy", "XXE injection", "Lab"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 23:05:51" znaku: 892 slov: 135 kodovani: "utf-8" sha256: "efb9d260c2869f49d14f1d14f016af2590df5a82321183a9c3c572f125b5416d" --- # Lab: Exploiting XInclude to retrieve files This lab has a "Check stock" feature that embeds the user input inside a server-side XML document that is subsequently parsed. Because you don't control the entire XML document you can't define a DTD to launch a classic XXE attack. To solve the lab, inject an `XInclude` statement to retrieve the contents of the `/etc/passwd` file. Hint By default, `XInclude` will try to parse the included document as XML. Since `/etc/passwd` isn't valid XML, you will need to add an extra attribute to the `XInclude` directive to change this behavior. Solution Visit a product page, click "Check stock", and intercept the resulting POST request in Burp Suite. Set the value of the `productId` parameter to: `` Community solutions Garr_7 Michael Sommer (no audio)