Skip to content

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

Merged
AvivDavid23 merged 1 commit into
8.10from
8.10_b54cdcef3ace43be379295bc26889038a0213eb7_cp
Jul 5, 2026
Merged

AvivDavid23 merged 1 commit into
8.10from
8.10_b54cdcef3ace43be379295bc26889038a0213eb7_cp

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

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_LoadFromRDB now rejects compressed chunks when stored size does not match the loaded data buffer length, when that length is not 8-byte aligned (gorilla word I/O), and when an inflated count is not consistent with the bit index idx (using idx/2 < count-1 to avoid overflow on huge count values).

series_rdb_load rejects series metadata where chunkSizeBytes is zero or not a multiple of 8.

test_borken_rdb.py adds RDB length encoding helpers and DUMP patchers to build valid-checksum malicious payloads (size/len mismatch, misaligned buffer, inflated count including 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.

@AvivDavid23
AvivDavid23 requested a review from gabsow July 5, 2026 12:06
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@AvivDavid23
AvivDavid23 merged commit 1cf1c3d into 8.10 Jul 5, 2026
37 of 38 checks passed
@AvivDavid23
AvivDavid23 deleted the 8.10_b54cdcef3ace43be379295bc26889038a0213eb7_cp branch July 5, 2026 12:27
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.

2 participants