make decoder check size of string before parsing the json
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start in lib/logstash/codecs/json.rb around the parsing point linked in the issue and inspect how the codec currently handles incoming strings. Define the configurable default size limit and make oversized JSON refuse parsing; completion means the limit is enforced before parsing and the behavior is covered by the codec's tests.
Written by the indexing model from the issue text.
Description
This codec is a privileged position to avoid the creation of huge events from arbitrarily large json documents.
Although the string itself has been alocated, if this codec had a size limit, we could prevent further damage down the pipeline flow.
All we need is a setting that by default is limited to some size like 50k, and here we can loudly refuse to parse the json if the json.byte_size is beyond that limit.
Thoughts?
- Dominant language
- Ruby
- Stars
- 26
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from logstash-plugins/logstash-codec-json
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
CompressionOpenenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
logstash-plugins/logstash-codec-json#42 · 4 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
logstash-plugins/logstash-codec-json#31 · 1 comment ·
-
1.5.0-rc3
Difficulty 3/5 1-2 days Newbie friendliness 45/100
logstash-plugins/logstash-codec-json#19 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
logstash-plugins/logstash-codec-json#15 · 9 comments · 8 reactions ·
All issues in logstash-plugins/logstash-codec-json
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
FinanceFlash/unvibecode#273 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
[Bug Report] Concurrent runs sharing a cold cache fail with JSON::ParserErrorPossibly taken @sarankumar1325 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
we-promise/sure#4481 ·
Maintainers usually reply within 1 day