Repository navigation
MOD-16653 Prevent more heap overflow + other rdb load asserions (#2086) - #2170
Merged
Merged
Conversation
|
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 malicious or corrupt RDB/DUMP input paths; legitimate dumps should be unchanged, but stricter validation could reject edge-case payloads that previously loaded.
Overview
Hardens RDB/DUMP restore for compressed time-series chunks by rejecting inconsistent or attacker-controlled metadata before Gorilla decompression can touch misaligned buffers.
In
Compressed_LoadFromRDB, deserialization now fails ifsize≠ the loaded data length, ifsizeis not 8-byte aligned, or if inflatedcountis inconsistent withidx(using an overflow-safeidx/2 < count-1check). Series load inrdb.calso rejectschunkSizeBytesof 0 or not a multiple of 8.Flow tests patch valid
DUMPpayloads (CRC-preserving) to assertRESTOREreturns Bad data format and the server stays healthy for size/length mismatch, non-aligned buffers, and bogus sample counts (including nearUINT64_MAXbypass attempts).Reviewed by Cursor Bugbot for commit 9d4bde4. Bugbot is set up for automated code reviews on this repo. Configure here.