Skip to content

Commit

Permalink
Disable access to external entities, fixes apache#4401
Browse files Browse the repository at this point in the history
  • Loading branch information
hansva committed Oct 9, 2024
1 parent 25c70d0 commit 6e2d6ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/apache/hop/core/xml/XmlHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ public static TransformerFactory createSecureTransformerFactory() {
try {
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
} catch (IllegalArgumentException e) {
transformerFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
} catch (IllegalArgumentException | TransformerException e) {
// Ignore this: the library doesn't support these features.
// We don't need to disable them.
}
Expand Down

0 comments on commit 6e2d6ba

Please sign in to comment.