diff --git a/pom.xml b/pom.xml
index 9fc00828ac..6d2d958d9e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1417,6 +1417,10 @@
Sebastian Peters
+
+ MatrixNeoKozak
+ matrixneo2026@tutamail.com
+
diff --git a/src/main/java/org/htmlunit/javascript/host/xml/XSLTProcessor.java b/src/main/java/org/htmlunit/javascript/host/xml/XSLTProcessor.java
index 4fc971aea9..21389e91da 100644
--- a/src/main/java/org/htmlunit/javascript/host/xml/XSLTProcessor.java
+++ b/src/main/java/org/htmlunit/javascript/host/xml/XSLTProcessor.java
@@ -58,6 +58,7 @@
*
* @author Ahmed Ashour
* @author Ronald Brill
+ * @author MatrixNeoKozak
*/
@JsxClass
public class XSLTProcessor extends HtmlUnitScriptable {
@@ -129,6 +130,18 @@ private Object transform(final Node source) {
// which sets a number of processing limits on the processors. Conversely, by default,
// the JDK turns off FSP for transformers and XPath, which enables extension functions for XSLT and XPath.
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ try {
+ transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ }
+ catch (final IllegalArgumentException ignored) {
+ // ignore
+ }
+ try {
+ transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
+ }
+ catch (final IllegalArgumentException ignored) {
+ // ignore
+ }
final SgmlPage page = sourceDomNode.getPage();
if (page != null && page.getWebClient().getBrowserVersion()
@@ -191,6 +204,12 @@ public Charset getContentCharset() {
}
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ try {
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ }
+ catch (final javax.xml.parsers.ParserConfigurationException ignored) {
+ // ignore
+ }
final org.w3c.dom.Document containerDocument = factory.newDocumentBuilder().newDocument();
final org.w3c.dom.Element containerElement = containerDocument.createElement("container");
containerDocument.appendChild(containerElement);