An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.
Where the Issue Occurred
The following code snippets display the usage of documentbuilderfactory without securely disabling entities:
The Issue
An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.
Where the Issue Occurred
The following code snippets display the usage of
documentbuilderfactory
without securely disabling entities:https://github.com/wseemann/JavaPlaylistParser/blob/c2c6c9fb54d135b02cfe8d9452566997cd86d9b1/src/wseemann/media/jplaylistparser/parser/asx/ASXPlaylistParser.java#L136
Remediation
https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet