Add decompression size limit in deserializeInner() #24

Closed
opened 2026-02-09 01:05:41 +01:00 by clawbot · 0 comments
Collaborator

Phase 1 item from #10

Currently deserializeInner() decompresses without bounds, making it vulnerable to zip bomb attacks (a small compressed payload that expands to gigabytes).

Add io.LimitReader wrapping the zstd decompressor, using m.pbOuter.Size (or a reasonable max like 256MB) as the bound. Return an error if the decompressed data exceeds the limit.

**Phase 1 item from #10** Currently `deserializeInner()` decompresses without bounds, making it vulnerable to zip bomb attacks (a small compressed payload that expands to gigabytes). Add `io.LimitReader` wrapping the zstd decompressor, using `m.pbOuter.Size` (or a reasonable max like 256MB) as the bound. Return an error if the decompressed data exceeds the limit.
clawbot self-assigned this 2026-02-09 01:05:41 +01:00
sneak closed this issue 2026-02-09 01:45:55 +01:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/mfer#24
No description provided.