Skip to content

Use full SHA-256 dedup lookup key#259

Merged
lukevalenta merged 1 commit into
mainfrom
lvalenta/full-sha256-dedup
Jul 16, 2026
Merged

Use full SHA-256 dedup lookup key#259
lukevalenta merged 1 commit into
mainfrom
lvalenta/full-sha256-dedup

Conversation

@lukevalenta

Copy link
Copy Markdown
Contributor

NOTE(lvalenta): I used AI to help write this PR, but have reviewed and approve all changes. Another approach we could have taken here is storing the signature in the cache too, but that is a more invasive change.

The deduplication cache keyed entries on a SHA-256 digest truncated to 128 bits. On a dedup hit the log signs an SCT over the submitted certificate combined with the cached leaf index and timestamp, so a collision in the lookup key yields an SCT for a certificate that was never incorporated into the log. With a 128-bit key an attacker with a colluding, compromised, or separately vulnerable CA could compute a collision offline (~2^64 work) and obtain a forged SCT. This is the same class of issue as Sunlight's ANT-2026-88EWBS43.

Widen LOOKUP_KEY_LEN from 16 to 32 bytes so new entries are keyed on the full SHA-256 digest, closing the collision hole (a collision now costs ~2^128, a multi-target second preimage ~2^96). Without the legacy fallback, this effectively resets the caches in Workers KV and DO storage for existing logs. As no Azul-based log is production, this seems acceptable.

The Durable Object dedup ring-buffer record grows from 32 to 48 bytes. Since one sequencing round is serialized into a single DO storage value, and DO values are capped at 128 KiB, lower MAX_POOL_SIZE from 4000 to 2500 (2500 * 48 = 120,000 B < 131,072 B; ceiling 2730) so a batch still fits in one value without chunking.

Closes #251

The deduplication cache keyed entries on a SHA-256 digest truncated to
128 bits. On a dedup hit the log signs an SCT over the *submitted*
certificate combined with the cached leaf index and timestamp, so a
collision in the lookup key yields an SCT for a certificate that was
never incorporated into the log. With a 128-bit key an attacker with a
colluding, compromised, or separately vulnerable CA could compute a
collision offline (~2^64 work) and obtain a forged SCT. This is the same
class of issue as Sunlight's ANT-2026-88EWBS43.

Widen LOOKUP_KEY_LEN from 16 to 32 bytes so new entries are keyed on the
full SHA-256 digest, closing the collision hole (a collision now costs
~2^128, a multi-target second preimage ~2^96). Without the legacy
fallback, this effectively resets the caches in Workers KV and DO
storage for existing logs. As no Azul-based log is production, this
seems acceptable.

The Durable Object dedup ring-buffer record grows from 32 to 48 bytes.
Since one sequencing round is serialized into a single DO storage value,
and DO values are capped at 128 KiB, lower MAX_POOL_SIZE from 4000 to
2500 (2500 * 48 = 120,000 B < 131,072 B; ceiling 2730) so a batch still
fits in one value without chunking.

Closes #251
@lukevalenta lukevalenta self-assigned this Jul 16, 2026
@lukevalenta
lukevalenta merged commit 7e0885c into main Jul 16, 2026
8 checks passed
@lukevalenta
lukevalenta deleted the lvalenta/full-sha256-dedup branch July 16, 2026 16:06
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.

Insert entries into dedup cache with full SHA-256 hash and signature

2 participants