AppSec A4-XML External Entities (XXE)
AppSec A4-XML External Entities (XXE)
If the XML files are internally stored, then review
the files and processing method
If the XML file is uploaded by the user, be strict
to verify the acceptable file format, length and
processor.
A4-XML External Entities (XXE)
Remedies
Restrict the content type and length
Use less complex data formats such as JSON and avoiding serialization of sensitive data.
Patch or upgrade all XML processors and libraries in use by the application or on the underlying
operating system. Use dependency checkers. Update SOAP to SOAP 1.2 or higher.
Disable XML external entity and DTD processing in all XML parsers in the application
Implement positive ("whitelisting") server-side input validation, filtering, or sanitization to prevent
hostile data within XML documents, headers, or nodes.
Verify that XML or XSL file upload functionality validates incoming XML using XSD validation or
similar.
If these controls are not possible, consider using virtual patching, API security gateways, or Web
Application Firewalls (WAFs) to detect, monitor to block XXE attacks.
SOAP(Simple Object Access Protocol): It is a messaging protocol specification for exchanging structured
information in the implementation of web services in computer networks.
DTD(Document Type Definition): It defines the document structure with a list of validated elements and
attributes.
A4-XML External Entities (XXE)
?