Hello, you are using an old browser that's unsafe and no longer supported. Please consider updating your browser to a newer version, or downloading a modern browser.

Glossary > XXE Prevention

What is XXE Prevention?

Understanding XXE Prevention

XXE (XML External Entity) Prevention addresses the threat where XML parsers process external entities pointing to system files or remote URLs, enabling attackers to read local files or perform server-side request forgery. By default, some XML libraries allow DTD-based expansions or expansions referencing local resources. Mitigation typically involves disabling DTD processing and external entity resolution. For Java, one sets `FEATURE_SECURE_PROCESSING`, in .NET modifies `XmlReaderSettings`, etc. Additional steps include limiting which protocols are allowed (no file:// or gopher://) or using simpler data formats that lack entity references. Attackers sometimes chain XXE with SSRF to pivot deeper into internal networks. Thorough testing involves scanning all possible XML inputs—REST endpoints, SOAP, document uploads—and verifying they can’t fetch unauthorized resources. Tools like Burp Suite or specialized scripts reveal if the parser is incorrectly configured. Given that many frameworks changed defaults over time, older deployments remain susceptible. A well-implemented parser typically rejects or ignores any external DTD references, ensuring no unexpected file or network calls occur. Properly controlling or disabling external entities prevents data leaks, internal port scanning, or direct OS file read/exfiltration exploits stemming from malicious XML payloads.

Learn More About XXE Prevention: