-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add system properties to configure Jackson's stream read constraints #15720
Add system properties to configure Jackson's stream read constraints #15720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just tweaking the defaults here: raising the number and message size by 10x. especially message size 20mb will be too low
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please backport to 8.12 after merging. |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
💚 Build Succeeded
History
|
@logstashmachine backport 8.12 |
…15720) (#15763) This commit added a few jvm.options properties to configure the Jackson read constraints defaults (Maximum Number value length, Maximum String value length, and Maximum Nesting depth). (cherry picked from commit a21ced0) Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
Release notes
Added
jvm.options
properties to configure the Jackson read constraints defaults (Maximum Number value length, Maximum String value length, and Maximum Nesting depth).What does this PR do?
This PR adds 3 new custom system properties into the
jvm.options
. Those new properties are used to fine-tune the default Jackson stream read constraints values, which are used by Jackson to guard against malicious input by preventing processing of too big inputs. The added properties can be found here.The intention of early set the Jackson defaults during the startup (
runner.rb
) was to ensure that all Logstash's functionalities that rely on Jackson are using those settings values.Why is it important/What is the impact to the user?
Although the Jackson's defaults works for the majority of users, it might be too restrictive - and a blocker - for pipelines receiving big payload requests or with a deeper level of nested objects.
Having the possibility of tuning those properties is essential to unblock users with that use-case and for a more accurate guard against malicious inputs.
Checklist
How to test this PR locally
-Dlogstash.jackson.stream-read-constraints.max-string-length=2
beats
inputcom.fasterxml.jackson.core.exc.StreamConstraintsException: String length (24) exceeds the maximum length (2)
Related issues