Add check in `BeanDeserializer._deserializeFromArray()` to prevent use of deeply nested arrays [CVE-2022-42004]
See original GitHub issueFix included in
- 2.13.4
- 2.12.7.1 micro-patch (jackson-bom 2.12.7.20221012)
(note: found by oss-fuzz, see: https://bugs.chromium.org/p/oss-fuzz/issues)
Currently feature DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS
is supported by most types, and deserializers tend to implement support using recursion, effectively allowing multiple nested layers of JSON Arrays to be unwrapped.
This is not a feature to support but just an implementation detail; ideally we should only allow a single JSON Array to wrap a value.
I think I have removed ability for deeper nesting from some other types so there may be some prior art.
Issue Analytics
- State:
- Created a year ago
- Comments:23 (7 by maintainers)
Top Results From Across the Web
Uncontrolled Resource Consumption in FasterXML jackson ...
_deserializeFromArray to prevent use of deeply nested arrays. ... exhaustion can occur because of a lack of a check in BeanDeserializer.
Read more >https://release.debian.org/proposed-updates/bullse...
... can occur because of a + lack of a check in BeanDeserializerBase.deserializeFromArray to prevent use of + deeply nested arrays.
Read more >Can't reduce a deeply nested array on MongoDB
Try below query : db.collection.aggregate([ /** Merge all arrays inside 'users' & push to 'summary' field */ { $project: { date: 1, ...
Read more >Array.prototype.flat() - JavaScript - MDN Web Docs
The flat() method creates a new array with all sub-array elements ... The depth level specifying how deep a nested array structure should...
Read more >Using ES6 To Destructure Deeply Nested Objects in ... - ITNEXT
Below is a screenshot of the object I was working with in my React application. This was my nested object, written in traditional...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@henryrneh I think it is reasonable to file a CVE for this, although one caveat is that it is only applicable if users enable specific
DeserializationFeature
and not with vanilla (default) setting ofObjectMapper
. So that should probably at least be reflect in applicability – I do not have any statistics of how common enabling this feature is but it probably is minority of usage.Big thank you @chadlwilson! I appreciate this and I am sure everyone with a Jackson dependency & sec scanning system does so too. 😃