Integer overflow in delta_signature_deserialize allocation #114
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
delta_signature_deserialize(),sig->block_countcomes from the network. The allocationmalloc(sig->block_count * sizeof(DeltaBlockSig))at delta.c:111 can overflow ifblock_countis large enough (e.g., > 536M on 64-bit), leading to a small allocation but subsequent out-of-bounds writes.Location
src/shared/delta.c:111
How to trigger
Send a crafted delta signature with a very large
block_countfield. The multiplication overflows, causing a small allocation. Subsequent writes in the loop write past the buffer.Suggested Fix
Add overflow check before allocation:
Severity
high
Category
security
Sub-Agent
security-screener (SC-3)
This issue was automatically generated by the issue-creator agent.
Fixed in PR #148 — merged into main on 2026-07-29. See #148