A comprehensive collection of XML External Entity (XXE) Injection payloads for penetration testing and security research. This repository contains carefully crafted payloads designed to test and exploit XXE vulnerabilities in web applications.
- About XXE Injection
- Payload Categories
- Installation
- Usage
- Payload Structure
- Detection Techniques
- Prevention
- Contributing
- Disclaimer
- References
- License
XML External Entity (XXE) injection is a web security vulnerability that allows an attacker to interfere with an application's processing of XML data. XXE vulnerabilities arise when an XML parser is configured to process external entities, allowing attackers to:
- Read arbitrary files from the server's filesystem
- Perform Server-Side Request Forgery (SSRF) attacks
- Execute Denial of Service (DoS) attacks
- Scan internal network infrastructure
- Exfiltrate sensitive data
- Critical: Arbitrary file reading, remote code execution
- High: Internal network scanning, SSRF
- Medium: Information disclosure, DoS
This repository contains the following payload categories:
| Category | File | Description |
|---|---|---|
| Basic XXE | Intruder/xxe-basic.txt |
Simple XXE payloads for file disclosure |
| File Disclosure | Intruder/xxe-file-disclosure.txt |
Comprehensive file reading payloads |
| SSRF via XXE | Intruder/xxe-ssrf.txt |
Server-Side Request Forgery payloads |
| Blind/Out-of-Band XXE | Intruder/xxe-blind-oob.txt |
Out-of-band data exfiltration |
| Error-Based XXE | Intruder/xxe-error-based.txt |
Error message exploitation |
| DoS/XML Bomb | Intruder/xxe-dos.txt |
Denial of Service payloads |
| XML Bomb | Intruder/xxe-xml-bomb.txt |
Billion laughs attack variants |
| XInclude XXE | Intruder/xxe-xinclude.txt |
XInclude-based payloads |
| SVG XXE | Intruder/xxe-svg.txt |
SVG file upload exploitation |
| SOAP XXE | Intruder/xxe-soap.txt |
SOAP protocol exploitation |
| PHP Wrappers | Intruder/xxe-php-wrappers.txt |
PHP filter wrapper payloads |
| UTF-7 Encoded | Intruder/xxe-utf7-encoded.txt |
UTF-7 encoded payloads |
| Parameter Entities | Intruder/xxe-parameter-entities.txt |
Parameter entity payloads |
| Exotic Protocols | Intruder/xxe-exotic-protocols.txt |
Uncommon protocol exploitation |
| Cloud Metadata | Intruder/xxe-cloud-metadata.txt |
Cloud provider metadata endpoints |
Clone the repository to your local machine:
git clone https://github.com/payload-box/xxe-injection-payload-list.git
cd xxe-injection-payload-list- Capture the request containing XML data in Burp Suite Proxy
- Send to Intruder (Right-click β Send to Intruder)
- Position the payload markers around the XML content or specific injection points
- Load payloads:
- Go to the "Payloads" tab
- Click "Load" button
- Select the appropriate payload file from the
Intruder/directory
- Configure payload processing if needed (encoding, etc.)
- Start the attack and analyze responses
You can manually test individual payloads by:
- Copying a payload from the appropriate file
- Replacing placeholders (e.g.,
ATTACKER_SERVER,FILE_PATH) - Injecting into the target application's XML input
- Monitoring the application's response
<!-- Basic File Reading -->
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<root>&xxe;</root>Each payload file in the Intruder/ directory contains:
- One payload per line for easy integration with Burp Suite Intruder
- Comments (where applicable) explaining the payload purpose
- Variations of similar attacks for maximum coverage
- Placeholders that need to be customized:
ATTACKER_SERVER- Your server/IP for out-of-band attacksFILE_PATH- Target file path to readPORT- Port number for SSRF attacks
- Input Analysis: Look for XML processing endpoints
- File Upload: Test with SVG, DOCX, XLSX files
- API Testing: SOAP, REST APIs accepting XML
- Error Messages: Verbose error messages may reveal parser details
- Response Time: Delayed responses may indicate blind XXE
- Out-of-Band: Monitor DNS/HTTP callbacks
- Burp Suite Professional (Collaborator)
- OWASP ZAP
- XMLStarlet
- interactsh.com (for OOB detection)
-
Disable External Entities:
// Java factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
-
Use Less Complex Data Formats: Consider JSON instead of XML
-
Update XML Processors: Keep libraries up-to-date
-
Input Validation: Validate and sanitize XML input
-
Disable DTD Processing:
# Python from defusedxml import ElementTree as ET
-
Whitelist-based Filtering: Only allow expected XML structures
- PHP: Use
libxml_disable_entity_loader(true) - .NET: Set
XmlReaderSettings.DtdProcessing = DtdProcessing.Prohibit - Python: Use
defusedxmllibrary - Java: Configure SAXParserFactory/DocumentBuilderFactory securely
Contributions are welcome! If you have additional XXE payloads or improvements:
- Fork the repository
- Create a new branch (
git checkout -b feature/new-payload) - Add your payloads to the appropriate Intruder file
- Update README.md if necessary
- Commit your changes (
git commit -am 'Add new XXE payload') - Push to the branch (
git push origin feature/new-payload) - Create a Pull Request
- One payload per line in Intruder files
- Include comments for complex payloads
- Test payloads before submitting
- Ensure payloads are ethical and legal to use in authorized testing
- Follow the existing format and structure
IMPORTANT: This repository is intended for authorized security testing and educational purposes only.
- β Use these payloads only on systems you own or have explicit permission to test
- β Obtain proper authorization before conducting any security assessments
- β The authors are not responsible for any misuse or damage caused by these payloads
- β Unauthorized access to computer systems is illegal
By using this repository, you agree to use it responsibly and legally.
- OWASP - XML External Entity (XXE) Processing
- PortSwigger Web Security Academy - XXE Injection
- CWE-611: Improper Restriction of XML External Entity Reference
- XML External Entity (XXE) Injection Attacks
- Exploiting XXE Vulnerabilities in File Upload Functionality
- Advanced XXE Exploitation Techniques
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for the Security Community
Happy (Ethical) Hunting! π―