question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add check in `BeanDeserializer._deserializeFromArray()` to prevent use of deeply nested arrays [CVE-2022-42004]

See original GitHub issue

Fix 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:closed
  • Created a year ago
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
cowtowncodercommented, Sep 9, 2022

@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 of ObjectMapper. 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.

3reactions
cowtowncodercommented, Oct 22, 2022

Big thank you @chadlwilson! I appreciate this and I am sure everyone with a Jackson dependency & sec scanning system does so too. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found