Skip to content

MOD-16653 Prevent more heap overflow + other rdb load asserions (#2086) - #2170

Merged
AvivDavid23 merged 2 commits into
1.10from
cherry-pick-b54cdcef-to-1.10
Sep 14, 2026
Merged

AvivDavid23 merged 2 commits into
1.10from
cherry-pick-b54cdcef-to-1.10

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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 if size ≠ the loaded data length, if size is not 8-byte aligned, or if inflated count is inconsistent with idx (using an overflow-safe idx/2 < count-1 check). Series load in rdb.c also rejects chunkSizeBytes of 0 or not a multiple of 8.

Flow tests patch valid DUMP payloads (CRC-preserving) to assert RESTORE returns Bad data format and the server stays healthy for size/length mismatch, non-aligned buffers, and bogus sample counts (including near UINT64_MAX bypass attempts).

Reviewed by Cursor Bugbot for commit 9d4bde4. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
42.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@AvivDavid23
AvivDavid23 merged commit c5a47d0 into 1.10 Sep 14, 2026
52 of 58 checks passed
@AvivDavid23
AvivDavid23 deleted the cherry-pick-b54cdcef-to-1.10 branch September 14, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant