0dd - The Zero (0) Day Division

The Zero (0) Day Division is a group of security professionals working towards a common goal; securing open-source projects.

Netbeans MMD Plugin XXE

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.

Netbeans MMD Plugin contains the functionality import MMD files. These MMD files are in XML format. 0dd identified that the parser used within the plugin program to parse XML was not securely implemented.

Where the Issue Occurred

The code below creates an XML parser which parses the MMD file passed to it:

The XML parser is set up on Line 149 of /mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java

final DocumentBuilder builder = factory.newDocumentBuilder();

The XML input is parsed on Line Line 159 of /mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java

document = builder.parse(stream);

Attack Scenario

An attacker coerces a user to open an MMD file, which utilises the weaknesses within the parser to execute unauthorise actions.

PoC File

File named Test.mmd

<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://0dd.zone">
]>
<r>&sp;</r>

Disclosure Timeline

  • Issue Reported: 30th May 2018
  • Issue Resolved: <TBD>
  • Blog Post Published: <TBD>
  • Applied for CVE: 24th June 2018