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.

LatexDraw 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.

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

Where the Issue Occurred

The code below creates an XML parser which parses the SVG file passed to it (found on line 87 - 90 latexdraw-core/net.sf.latexdraw/src/main/java/net/sf/latexdraw/parsers/svg/SVGDocument.java#L87-L90):

builder.setEntityResolver(new SVGEntityResolver()); 
Document doc; 
try { 
	doc = builder.parse(uri.getPath()); 

Attack Scenario

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

Disclosure Timeline

  • Issue Reported: 18th July 2018
  • Issue Resolved: <TBD>
  • Blog Post Published: 8th August 2018
  • Applied for CVE: 8th August 2018