Strengthen scroll_id validation - #22396
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for 37a93f6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22396 +/- ##
============================================
- Coverage 73.52% 73.52% -0.01%
+ Complexity 76254 76240 -14
============================================
Files 6076 6076
Lines 345790 345793 +3
Branches 49762 49763 +1
============================================
+ Hits 254236 254238 +2
+ Misses 71371 71343 -28
- Partials 20183 20212 +29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Adds bounds checking on the varint-encoded count in
TransportSearchHelper.parseScrollId(). Previously, a crafted scroll ID encoding a massive count (e.g.,Integer.MAX_VALUE) would cause an OOM by allocating an oversized array before any data was read. The fix validates that the decoded count does not exceed the remaining payload size.Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.