Repository navigation
MOD-16653 Prevent more heap overflow + other rdb load asserions (#2086) - #2087
Merged
AvivDavid23 merged 1 commit intoJul 5, 2026
Merged
Conversation
|
gabsow
approved these changes
Jul 5, 2026
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.


Note
Medium Risk
Changes only affect untrusted RDB/RESTORE input parsing but touch memory-layout-sensitive gorilla chunk loading; overly strict checks could reject rare legitimate dumps if any exist.
Overview
Hardens RESTORE / RDB load against crafted time-series payloads that could previously pass checksums but still trigger heap overflows or inconsistent gorilla chunk state.
Compressed_LoadFromRDBnow rejects compressed chunks when storedsizedoes not match the loaded data buffer length, when that length is not 8-byte aligned (gorilla word I/O), and when an inflatedcountis not consistent with the bit indexidx(usingidx/2 < count-1to avoid overflow on hugecountvalues).series_rdb_loadrejects series metadata wherechunkSizeBytesis zero or not a multiple of 8.test_borken_rdb.pyadds RDB length encoding helpers and DUMP patchers to build valid-checksum malicious payloads (size/len mismatch, misaligned buffer, inflatedcountincluding near-UINT64_MAX), asserting RESTORE fails and the key is not created.Reviewed by Cursor Bugbot for commit cacd9aa. Bugbot is set up for automated code reviews on this repo. Configure here.