Skip to content

Commit f44e693

Browse files
HaxatronAngledLuffa
authored andcommitted
Fix XML schema vulnerability
1 parent 820192c commit f44e693

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/edu/stanford/nlp/util/XMLUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ public static DocumentBuilder getValidatingXmlParser(File schemaFile) {
302302
DocumentBuilderFactory dbf = safeDocumentBuilderFactory();
303303

304304
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
305+
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
305306
Schema schema = factory.newSchema(schemaFile);
306307
dbf.setSchema(schema);
307308

0 commit comments

Comments
 (0)