Skip to content

Commit 4236899

Browse files
committed
Merge branch '2.9' into 2.10
2 parents 053b5e3 + 0fa6e93 commit 4236899

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

release-notes/VERSION-2.x

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Project: jackson-databind
44
=== Releases ===
55
------------------------------------------------------------------------
66

7+
(not yet released)
8+
9+
#2589: `DOMDeserializer`: setExpandEntityReferences(false) may not prevent
10+
external entity expansion in all cases (CVE-2020-25649)
11+
(reported by Bartosz B)
12+
713
2.10.5 (21-Jul-2020)
814

915
#2787 (partial fix): NPE after add mixin for enum

src/main/java/com/fasterxml/jackson/databind/ext/DOMDeserializer.java

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ public abstract class DOMDeserializer<T> extends FromStringDeserializer<T>
3939
// 14-Jul-2016, tatu: Not sure how or why, but during code coverage runs
4040
// (via Cobertura) we get `java.lang.AbstractMethodError` so... ignore that too
4141
}
42+
43+
// [databind#2589] add two more settings just in case
44+
try {
45+
parserFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
46+
} catch (Throwable t) { } // as per previous one, nothing much to do
47+
try {
48+
parserFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
49+
} catch (Throwable t) { } // as per previous one, nothing much to do
4250
DEFAULT_PARSER_FACTORY = parserFactory;
4351
}
4452

0 commit comments

Comments
 (0)