Skip to content

Tighten decoder image/alloc caps and fail closed on Huffman amplification - #19

Open
M0nd0R wants to merge 1 commit into
webmproject:mainfrom
M0nd0R:harden-decoder-bounds
Open

Tighten decoder image/alloc caps and fail closed on Huffman amplification#19
M0nd0R wants to merge 1 commit into
webmproject:mainfrom
M0nd0R:harden-decoder-bounds

Conversation

@M0nd0R

@M0nd0R M0nd0R commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Align MAX_IMAGE_AREA with the encoder WEBP_MAX_DIMENSION (16383²) so crafted VP8X dimensions cannot request multi-GiB canvases.
  • Lower default WEBP_MAX_ALLOCABLE_MEMORY from 16GiB to 1GiB (overrideable at compile time).
  • Fail closed when lossless meta-Huffman advertises more than 1000 groups (or more than the pixel count), instead of remapping and still parsing unused Huffman tables.

Test plan

  • Build libwebp
  • Existing decoder / anim / demux tests
  • Oversized VP8X canvas is rejected
  • Lossless stream with sparse high Huffman group IDs is rejected

…lification.

Align MAX_IMAGE_AREA with the encoder WEBP_MAX_DIMENSION limit, lower the
default WEBP_MAX_ALLOCABLE_MEMORY ceiling from 16GiB to 1GiB, and reject
lossless meta-Huffman bitstreams that advertise more than 1000 groups
instead of still parsing unused tables.
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.

1 participant