Skip to content

Commit 9ce24fb

Browse files
committed
Security 2625 fixed
1 parent 2c88655 commit 9ce24fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/compuware/jenkins/totaltest/TotalTestCTRunner.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ else if (extension.compareTo(FILE_EXT_XAUNIT) == 0 ||
323323
private Document getXaScenarioSuiteResultAsDocument(String xml) throws Exception //NOSONAR
324324
{
325325
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
326+
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
327+
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
328+
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
329+
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
330+
dbf.setXIncludeAware(false);
331+
dbf.setExpandEntityReferences(false);
326332
DocumentBuilder db = dbf.newDocumentBuilder();
327333
Reader r = new StringReader(xml);
328334
return db.parse(new InputSource(r));

0 commit comments

Comments
 (0)