Skip to content

Commit

Permalink
Fix #2589 (#2901)
Browse files Browse the repository at this point in the history
Co-authored-by: Tatu Saloranta <tatu.saloranta@iki.fi>
  • Loading branch information
jgallimore and cowtowncoder committed Oct 23, 2020
1 parent c818d4d commit 3d93270
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Expand Up @@ -872,3 +872,8 @@ Kaki King (kingkk9279@g)
Jon Anderson (Jon901@github)
* Reported #2544: java.lang.NoClassDefFoundError Thrown for compact profile1
(2.9.10.2)

Bartosz Baranowski (baranowb@github)
* Reported #2589: `DOMDeserializer`: setExpandEntityReferences(false) may not prevent
external entity expansion in all cases
(2.9.10.7)
4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Expand Up @@ -6,6 +6,10 @@ Project: jackson-databind

2.9.10.7 (not yet released)

#2589: `DOMDeserializer`: setExpandEntityReferences(false) may not prevent
external entity expansion in all cases
(reported by Bartosz B)

#2854: Block one more gadget type (javax.swing, CVE-2020-xxx)
(reported by Yangkun(ICSL))

Expand Down
Expand Up @@ -39,6 +39,14 @@ public abstract class DOMDeserializer<T> extends FromStringDeserializer<T>
// 14-Jul-2016, tatu: Not sure how or why, but during code coverage runs
// (via Cobertura) we get `java.lang.AbstractMethodError` so... ignore that too
}

// [databind#2589] add two more settings just in case
try {
parserFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
} catch (Throwable t) { } // as per previous one, nothing much to do
try {
parserFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (Throwable t) { } // as per previous one, nothing much to do
DEFAULT_PARSER_FACTORY = parserFactory;
}

Expand Down

0 comments on commit 3d93270

Please sign in to comment.