FreeCol / freecol

FreeCol: FreeCol is a turn-based strategy game based on the old game Colonization, and similar to Civilization. The objective of the game is to create an independent nation.
GNU General Public License v2.0
588 stars 173 forks source link

XXE in FreeColXMLReader.java #26

Closed prodigysml closed 4 years ago

prodigysml commented 5 years ago

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 XMLInputFactory without securely disabling entities:

https://github.com/FreeCol/freecol/blob/ef284d78a4dd2337d43c68d929423b5ab423a0b0/src/net/sf/freecol/common/io/FreeColXMLReader.java#L149

Remediation

https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet

mpope042 commented 4 years ago

Fixed in master on 20191227.

carnil commented 4 years ago

Fixing commit seems to be 8963506897e3270a75b062f28486934bcb79b1e3