Skip to content

Commit

Permalink
Set OPTION_USE_PACKAGE_NS_URI_AS_LOCATION to false
Browse files Browse the repository at this point in the history
- See #946
  • Loading branch information
Phillipus committed Jul 14, 2023
1 parent ad679a4 commit bcab676
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public Resource createResource(URI uri) {
resource.getDefaultLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
resource.setIntrinsicIDToEObjectMap(new HashMap<String, EObject>());

// Don't allow loading an unregistered URI in case of exploits
resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_PACKAGE_NS_URI_AS_LOCATION, false);

Map<String, Object> parserFeatures = new HashMap<String, Object>();
// Don't allow DTD loading in case of XSS exploits
Expand Down

0 comments on commit bcab676

Please sign in to comment.