Skip to content

Commit

Permalink
[#702] Disable access to external entities in XML parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
opatrascoiu committed Sep 9, 2024
1 parent 007272b commit 3fa673d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void serialize(NSElement element, JsonGenerator gen, SerializerProvider s
private static String toXml(Element element) {
try {
TransformerFactory factory = TransformerFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
StringWriter writer = new StringWriter();
Expand Down

0 comments on commit 3fa673d

Please sign in to comment.