Skip to content

fix: revert to jackson 2.x default behavior for primitives types - #2052

Merged
netomi merged 2 commits into
mainfrom
fix-jackson-default
Aug 7, 2026
Merged

fix: revert to jackson 2.x default behavior for primitives types#2052
netomi merged 2 commits into
mainfrom
fix-jackson-default

Conversation

@netomi

@netomi netomi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

With the upgrade to jackson 3.x, we see now these log messages:

JSON parse error: Cannot map `null` into type `int` (set `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES` to 'false' to allow)]

to keep backwards compatibility, disable that feature which is enabled by default in jackson 3.x

@netomi
netomi requested a review from cstamas August 7, 2026 16:11

@cstamas cstamas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@netomi
netomi merged commit 4799ed7 into main Aug 7, 2026
5 checks passed
@netomi
netomi deleted the fix-jackson-default branch August 7, 2026 20:29
netomi added a commit that referenced this pull request Aug 8, 2026
- Sanitize and bound the Jackson parse-failure message before putting
  it into the ResponseStatusException reason: strip control
  characters/newlines and truncate to 200 chars, since it is derived
  from attacker-controlled input and Spring propagates the reason into
  the response status line.
- Add a POST regression test for #2059 (the
  actual reported incident), confirming the @RequestBody path fixed by
  JacksonConfig (#2052) still works end-to-end with pageNumber missing
  from the sibling sortBy/sortOrder fields.
- Add a test asserting the sanitized message is single-line and length
  bounded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
netomi added a commit that referenced this pull request Aug 8, 2026
* fix: use jackson 2 compatible mapper for extensionquery

* fix: address review comments on #2061

- Sanitize and bound the Jackson parse-failure message before putting
  it into the ResponseStatusException reason: strip control
  characters/newlines and truncate to 200 chars, since it is derived
  from attacker-controlled input and Spring propagates the reason into
  the response status line.
- Add a POST regression test for #2059 (the
  actual reported incident), confirming the @RequestBody path fixed by
  JacksonConfig (#2052) still works end-to-end with pageNumber missing
  from the sibling sortBy/sortOrder fields.
- Add a test asserting the sanitized message is single-line and length
  bounded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants