Skip to content

Commit 067c8b2

Browse files
committed
[bugfix] fn:transform - sonartype check
fix flagged vulnerability
1 parent 3f41d99 commit 067c8b2

File tree

1 file changed

+4
-0
lines changed
  • exist-core/src/main/java/org/exist/xquery/functions/fn/transform

1 file changed

+4
-0
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Options.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.w3c.dom.Node;
4848

4949
import javax.annotation.Nullable;
50+
import javax.xml.XMLConstants;
5051
import javax.xml.stream.XMLEventReader;
5152
import javax.xml.stream.XMLInputFactory;
5253
import javax.xml.stream.XMLStreamConstants;
@@ -589,6 +590,9 @@ private float domExtractXsltVersion(final Source xsltStylesheet) throws XPathExc
589590
private float staxExtractXsltVersion(final Source xsltStylesheet) throws XPathException {
590591
try {
591592
final XMLInputFactory factory = XMLInputFactory.newInstance();
593+
// Sonartype checker needs this https://rules.sonarsource.com/java/RSPEC-2755
594+
factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
595+
592596
final XMLEventReader eventReader =
593597
factory.createXMLEventReader(xsltStylesheet);
594598

0 commit comments

Comments
 (0)