Skip to content

Commit ce971b3

Browse files
committed
add fix
1 parent 97a2b0c commit ce971b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/acme/XXEVulnFixed.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public static Document withDomButDisabled(String xml)
8989
public static void withReaderFactory(String xml)
9090
throws IOException, SAXException {
9191
XMLReader reader = XMLReaderFactory.createXMLReader();
92+
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
93+
reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
9294
reader.parse(new InputSource(new StringReader(xml)));
9395
}
9496
}

0 commit comments

Comments
 (0)