CVE-2026-42500: Go x/image panic in BMP decoder

CVE-2026-42500 · Severity: medium · CVSS 5.3 · Published 2026-05-29

A vulnerability exists in the Go programming language's image processing library, specifically when handling BMP image files. An attacker can provide a specially crafted image file that causes the application to crash (panic) when it attempts to read the image data. This can lead to a denial-of-service, potentially disrupting services that process user-uploaded images.

Technologies: golang.org/x/image (Go). Vendors: Go, Go Project.

Quick answers

Is CVE-2026-42500 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-42500 being exploited in the wild.
How severe is CVE-2026-42500?
Medium severity, with a CVSS score of 5.3, published 29 May 2026.
Which products and versions are affected?
golang.org/x/image (Go) SEMVER:introduced=0,fixed=0.41.0; Go Project X/Image/Bmp before v0.41.0.
Is there a fix for CVE-2026-42500?
Yes. golang.org/x/image (Go): upgrade to 0.41.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-42500 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-42500?
Check whether you run golang.org/x/image (Go) or Go Project X/Image/Bmp at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • golang.org/x/image (Go): upgrade to 0.41.0 or later
    go get golang.org/x/image@v0.41.0

Technical details

A denial-of-service vulnerability exists in the golang.org/x/image/bmp package. The issue is caused by a lack of bounds checking when decoding paletted BMP files; specifically, an out-of-range palette index triggers a runtime panic when the application attempts to access pixels in the resulting invalid image object. This can be exploited by a remote, unauthenticated attacker who provides a malformed BMP file to an application using the affected library's Decode function. The vulnerability is addressed in version v0.41.0 of the golang.org/x/image package.

Affected products

  • Go Project golang.org/x/image/bmp before v0.41.0

Identifiers

  • CVE-2026-42500
  • GO-2026-5031

Timeline

  • 2026-05-21: disclosed: Issue reported on GitHub
  • 2026-05-29: advisory: CVE published and Go vulnerability report released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.