Skip to content

fix(dv): reject trailing bitmap data - #1625

Open
fallintoplace wants to merge 3 commits into
apache:mainfrom
fallintoplace:fix/dv-reject-trailing-bitmap-data
Open

fix(dv): reject trailing bitmap data#1625
fallintoplace wants to merge 3 commits into
apache:mainfrom
fallintoplace:fix/dv-reject-trailing-bitmap-data

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject trailing bytes after a portable roaring position bitmap.

Problem

The portable format starts with the number of keyed bitmaps, so that count frames the complete payload. The decoder reads exactly that many entries but does not verify that the input is exhausted afterward. As a result, an otherwise valid bitmap with arbitrary trailing bytes is accepted and the extra data is silently ignored.

For deletion vectors this weakens corruption detection because malformed inner bitmap data can pass decoding even when the outer DV length and CRC are valid.

Fix

After decoding the declared bitmap entries, require the input reader to have no bytes remaining.

Tests

Added framing coverage for empty and multi-key non-empty bitmaps. An end-to-end DV envelope test also appends bytes to a valid bitmap, rebuilds the matching length and CRC, and verifies the contextual decode error.

go test ./table/dv -count=1

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