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

Source: https://junglewise.ai/threats/cve-2026-42500-go-x-image-panic-in-bmp-decoder  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-29. Updated: 2026-05-29  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/golang-org-x-image). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Go Project](https://junglewise.ai/threats/vendors/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

  ```sh
  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

- [https://go.dev/cl/781500](https://go.dev/cl/781500)
- [https://go.dev/issue/79576](https://go.dev/issue/79576)
- [https://groups.google.com/g/golang-announce/c/uhYX90BlBvI](https://groups.google.com/g/golang-announce/c/uhYX90BlBvI)
- [https://pkg.go.dev/vuln/GO-2026-5031](https://pkg.go.dev/vuln/GO-2026-5031)

## Related threats

- [GO-2026-6222 - Excessive memory allocation during VP8L decoding in golang.org/x/image](https://junglewise.ai/threats/cve-2026-46603-go-2026-6222-excessive-memory-allocation-during-vp8l-decoding-in)
- [Go x/image/tiff denial of service via out-of-bounds strip offset](https://junglewise.ai/threats/cve-2026-46604-go-x-image-tiff-denial-of-service-via-out-of-bounds-strip-offset)
- [Go x/image/tiff unbounded memory consumption in TIFF decoder](https://junglewise.ai/threats/cve-2026-46602-go-x-image-tiff-unbounded-memory-consumption-in-tiff-decoder)
- [Go x/image/webp denial of service via mismatched VP8 dimensions](https://junglewise.ai/threats/cve-2026-46601-go-x-image-webp-denial-of-service-via-mismatched-vp8-dimensions)
- [Go x/image/tiff resource exhaustion in PackBits decompression](https://junglewise.ai/threats/cve-2026-46599-go-x-image-tiff-resource-exhaustion-in-packbits-decompression)
