-
Initial Information Gathering
- Identify and map all endpoints that accept XML input.
- Review source code (if available) to understand XML parsing mechanisms.
- Check for user inputs in XML request bodies, SOAP messages, and API endpoints.
-
Basic XXE Testing
- Test with a basic XXE payload to identify vulnerabilities:
- Inject the payload in different parts of the XML (e.g., elements, attributes).
-
XXE Payloads
- Test for blind XXE using out-of-band (OOB) techniques:
- Test for SSRF (Server-Side Request Forgery):
- Test for file inclusion vulnerabilities with common files:
-
/etc/passwd
-
/etc/hosts
-
C:\Windows\win.ini
-
-
Parameter Entities and XML Injection
- Test with parameter entities:
- Test XML injection to manipulate the structure and content:
-
Recursive Entities
- Test for recursive entity expansion (Billion Laughs Attack):
<!DOCTYPE lolz [ <!ENTITY lol "lol"> <!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;"> <!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;"> <!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>
- Test for recursive entity expansion (Billion Laughs Attack):
-
Out-of-Band (OOB) Detection
- Set up an OOB endpoint to detect blind XXE:
- Use tools like Burp Collaborator to capture OOB interactions.
-
Error Handling and Response Analysis
- Analyze server responses for clues about XXE vulnerabilities.
- Look for error messages that disclose file paths or other sensitive information.
- Verify if application stack traces are exposed in responses.
-
SOAP Services
- Test SOAP-based services for XXE vulnerabilities: