Skip to content

Commit

Permalink
XWIKI-20320: Disallow DOCTYPE in the XAR descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
vmassol committed Nov 4, 2022
1 parent c68c0df commit e3527b9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ public void readDescriptor(InputStream stream) throws XarException, IOException

DocumentBuilder dBuilder;
try {
// Prevent XXE attack
dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
dBuilder = dbFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new XarException("Failed to create a new Document builder", e);
Expand Down

0 comments on commit e3527b9

Please # to comment.