Skip to content

Commit

Permalink
Fix #2589
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 10, 2020
1 parent 0e758be commit 612f971
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Expand Up @@ -1051,3 +1051,8 @@ Joseph Koshakow (jkosh44@github)
Haowei Wen (yushijinhun@github)
* Reported #2565: Java 8 `Optional` not working with `@JsonUnwrapped` on unwrappable type
(2.11.0)

Bartosz Baranowski (baranowb@github)
* Reported #2589: `DOMDeserializer`: setExpandEntityReferences(false) may not prevent
external entity expansion in all cases
(2.11.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Expand Up @@ -34,6 +34,9 @@ Project: jackson-databind
(reported by Haowei W)
#2573: Add `MapperFeature.BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES` to allow blocking
use of unsafe base type for polymorphic deserialization
#2589: `DOMDeserializer`: setExpandEntityReferences(false) may not prevent
external entity expansion in all cases
(reported by Bartosz B)
- Add `SerializerProvider.findContentValueSerializer()` methods

2.10.2 (05-Jan-2020)
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

2 comments on commit 612f971

@stephanborn
Copy link

@stephanborn stephanborn commented on 612f971 Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cowtowncoder - Will this fix also be applied to 2.9.10.x? I see that you have applied the fix also to version 2.6.7.4. It would be great if 2.9.10.7 would be released with this fix, too. We just have upgraded a few days ago to 2.9.10.6 for some other security issues.

@cowtowncoder
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephanborn yes, it was merged in 2.9 branch and will be included in 2.9.10.7, whenever that is released.
Since 2.9 branch will be EOL'ed at end of 2020 I'll have to figure out good timing as there is not much upside to making frequent micro-patch releases at this point.

Please sign in to comment.