Skip to content

x/image/webp: VP8L chunk dimension validation comes too late #80063

Closed

Description

@neild

Consider a WEBP image containing a VP8X chunk giving one set of dimensions, followed by a VP8L chunk with a different set of dimensions.

DecodeConfig reports the dimensions from the VP8X chunk.

Decoding will decode the VP8L chunk, detect the mismatch, and return an error. However, this error is only reported after allocating memory for the VP8L chunk. At the maximum VP8L chunk size (16384x16384), that's a 1GiB transient allocation.

Credit to herdiyana256 for noticing this in https://go.dev/cl/774460.

1GiB is a lot, but this is a transient allocation. We've tentatively decided to call this a hardening measure rather than a vulnerability.

Activity

  1. added this to the Unreleased milestone on Jun 18, 2026
  2. gopherbot commented on Jun 18, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/792240 mentions this issue: webp: check for VP8L dimension mismatch before allocation

  3. added
    FixPendingIssues that have a fix which has not yet been reviewed or submitted.
    on Jun 18, 2026
  4. added a commit that references this issue on Jun 29, 2026
    7a0cfda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions