Skip to content

Commit

Permalink
[java] Preventing XXE when loading Firefox extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 29, 2019
1 parent 420921b commit 7a01fd8
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ private String readIdFromInstallRdf(File root) {
File installRdf = new File(root, "install.rdf");

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setNamespaceAware(true);
factory.setExpandEntityReferences(false);
DocumentBuilder builder = factory.newDocumentBuilder();
Expand Down

0 comments on commit 7a01fd8

Please sign in to comment.