Skip to content

Commit

Permalink
Repair XXE vulnerability at initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
zhutougg authored Dec 20, 2018
1 parent 6796e1d commit 2eb0ea9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/java/com/mchange/v2/c3p0/cfg/C3P0ConfigXmlUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public static C3P0Config extractXmlConfigFromDefaultResource() throws Exception
public static C3P0Config extractXmlConfigFromInputStream(InputStream is) throws Exception
{
DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
fact.setExpandEntityReferences(false);
DocumentBuilder db = fact.newDocumentBuilder();
Document doc = db.parse( is );

Expand Down

2 comments on commit 2eb0ea9

@crazyguyonabike
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this actually fixes the CVE, can you do a PR to the original source and/or make a release?

@mprins
Copy link

@mprins mprins commented on 2eb0ea9 Feb 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is resolved in v.0.9.5.3 in a more elegant way, see: swaldman@7dfdda6

Please # to comment.