Skip to content

harden seek table parsing against overflow and oversized frame metadata#4638

Open
metsw24-max wants to merge 1 commit intofacebook:devfrom
metsw24-max:seekable-table-overflow-hardening
Open

harden seek table parsing against overflow and oversized frame metadata#4638
metsw24-max wants to merge 1 commit intofacebook:devfrom
metsw24-max:seekable-table-overflow-hardening

Conversation

@metsw24-max
Copy link
Copy Markdown

This hardens seek table parsing in zstdseek_decompress.c by adding strict bounds checks for untrusted metadata before size arithmetic and memory allocation

Added a hard upper bound check for numFrames from seek table metadata

Added checked arithmetic for table size and frame size computations before multiply/add operations

Added allocation-size overflow guards when allocating seek entries in load path and clone path

These checks reduce memory safety risk by ensuring untrusted metadata cannot trigger wrapped size calculations or undersized allocations.

@meta-cla meta-cla bot added the CLA Signed label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant