Skip to content
Fossil Update of ”checkin/e4cdf03b4547c838ec0ea417bc12ac1505cf7c670216e59da1109c34ad5155ae”
Login

Update of ”checkin/e4cdf03b4547c838ec0ea417bc12ac1505cf7c670216e59da1109c34ad5155ae”

Overview

Artifact ID: c5f00c2226126cc165d1fbdb81fc8181246b33e1c407b21bf656f8e8517e5a33
Page Name:checkin/e4cdf03b4547c838ec0ea417bc12ac1505cf7c670216e59da1109c34ad5155ae
Date: 2026-11-11 21:59:30
Original User: dmestas
Mimetype:text/x-markdown
Content

Heap buffer overflow in blob_delta_create()

blob_delta_create() gave delta_create() an output buffer 16 bytes larger than the target. delta_create() documents a need for 60.

A delta whose target shares nothing with its source is one literal: SIZE\nSIZE:, the target, then CHECKSUM;. Once the target reaches 2^24 bytes, SIZE takes five base-64 digits and the overhead is up to 19 bytes. The last one or two bytes landed past the end of the buffer.

It is reached from commit (content_deltify), sync (send_delta_native), stash and bundle export, whenever a file of 16 MB or more is deltified against content it has nothing in common with.

The fix allocates 60 extra bytes, as the contract says. The other callers of delta_create() already allocate 70.

To see it, on an ASan build of the parent check-in:

head -c 17000000 /dev/urandom >t
head -c 100 /dev/urandom >s
fossil test-delta-create s t d