Deletion vector bitmap count is read from the blob and used as a loop bound without validation

Open Beginner friendly
#3,979 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
security

Research direction

Start at DeletionVector._deserialize_bitmap and trace its callers and nearby tests. Exercise a payload whose declared bitmap count exceeds its available data, then add validation so malformed input cannot use that count as an unbounded loop; done when the existing valid format still deserializes and the malformed case is covered.

Written by the indexing model from the issue text.

Description

bug

DeletionVector._deserialize_bitmap reads an 8-byte count from the start of the payload and uses it directly as a loop bound, appending to a list on each iteration:

number_of_bitmaps = int.from_bytes(pl[0:8], byteorder="little")
...
for _ in range(number_of_bitmaps):
    ...
    bitmaps.append(bm)

Nothing checks the declared count against the actual payload length, so a small blob can declare a large number of bitmaps.


Issue investigation generated via claude, reviewed by Sung, Kevin, Fokko.

Dominant language
Python
Stars
1.1k
Forks
589
Avg merge
2d 4h
Merged PRs (30d)
72

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-python

All issues in apache/iceberg-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.