DocumentBuilderFactory limiting (#5797)

This commit is contained in:
Anthony Stirling
2026-02-25 17:25:31 +00:00
committed by GitHub
parent c9e7d9d6c9
commit 9438b8db29
3 changed files with 6 additions and 2 deletions
@@ -86,7 +86,7 @@ public class SvgSanitizer {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);