json-fuzz: prevent large size inputs#40855
Merged
botengyao merged 2 commits intoenvoyproxy:mainfrom Aug 26, 2025
Merged
Conversation
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
botengyao
previously approved these changes
Aug 26, 2025
Member
botengyao
left a comment
There was a problem hiding this comment.
Thanks for addressing this!
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
zuercher
approved these changes
Aug 26, 2025
wtzhang23
pushed a commit
to wtzhang23/envoy
that referenced
this pull request
Aug 27, 2025
Commit Message: json-fuzz: prevent large size inputs Additional Description: The original [fuzzer test-case](https://oss-fuzz.com/testcase-detail/4819251528007680) created a large input file with ~1MiB of base64 contents that was truncated in the middle and caused the fuzzer to OOM due to a test-function allocation: ``` envoyproxy#9 0x5ca72f569401 in testing::internal::edit_distance::CreateUnifiedDiff(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, unsigned long) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:1352:39 ``` This PR limits the input sizes for the json input to 32KiB, as most errors should be detected with this limit. Risk Level: low - tests only Testing: N/A Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Fixes fuzz issue [421951268](https://issues.oss-fuzz.com/issues/421951268). --------- Signed-off-by: Adi Suissa-Peleg <adip@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: json-fuzz: prevent large size inputs
Additional Description:
The original fuzzer test-case created a large input file with ~1MiB of base64 contents that was truncated in the middle and caused the fuzzer to OOM due to a test-function allocation:
This PR limits the input sizes for the json input to 32KiB, as most errors should be detected with this limit.
Risk Level: low - tests only
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Fixes fuzz issue 421951268.