Skip to main content
Vulnerability Database/CVE-2026-111138

CVE-2026-111138: NetSurf libnsbmp Buffer Overflow Flaw

CVE-2026-111138 is a buffer overflow flaw in NetSurf libnsbmp that causes out-of-bounds reads in RLE8 and RLE4 BMP decoding. This article covers the technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111138 Overview

CVE-2026-111138 is an out-of-bounds read vulnerability in NetSurf libnsbmp through version 0.1.7. The flaw resides in the bmp_decode_rle8() and bmp_decode_rle4() functions, where absolute-run bound checks omit the word-alignment pad byte required by the BMP RLE encoding specification. An attacker who supplies a crafted RLE8 or RLE4 BMP image ending on an odd-length absolute run can trigger a one-byte heap over-read. Applications that decode untrusted BMP images using libnsbmp can crash, producing a denial-of-service condition. The vulnerability is tracked under [CWE-125: Out-of-bounds Read].

Critical Impact

Applications decoding untrusted BMP images with libnsbmp can be forced to crash through a one-byte heap over-read triggered by malformed RLE-compressed BMP files.

Affected Products

  • NetSurf libnsbmp through version 0.1.7
  • Applications linking against vulnerable libnsbmp builds for BMP decoding
  • NetSurf browser components that rely on libnsbmp for image rendering

Discovery Timeline

  • 2026-10-15 - CVE-2026-111138 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-111138

Vulnerability Analysis

The vulnerability affects the Run-Length Encoding (RLE) decoders in libnsbmp.c. BMP RLE4 and RLE8 compression modes support absolute-run segments that embed raw pixel data inline. The BMP specification requires absolute runs to be word-aligned, inserting a pad byte when the pixel count is odd. The decoder validates buffer bounds based on the pixel count, but fails to account for this trailing pad byte.

When a crafted image terminates with an odd-length absolute run positioned at the exact end of the input buffer, the decoder advances one byte past the allocated region. This produces a one-byte heap over-read. The read value is not returned to the attacker, so the impact is limited to availability. Applications that invoke libnsbmp on attacker-controlled images, including browsers, image viewers, and preview generators, can be crashed on demand.

Root Cause

The root cause is incomplete bounds validation in bmp_decode_rle8() and bmp_decode_rle4(). The size calculation covers only the pixel payload and omits the mandatory word-alignment pad byte that follows odd-length absolute runs. Source references are available at libnsbmp.c lines 942-982 and libnsbmp.c lines 1096-1147.

Attack Vector

Exploitation requires an attacker to deliver a malformed BMP file to a victim application that invokes the vulnerable decoder. The attack vector is local, and user interaction is required to open or process the image. Successful exploitation causes the host application to crash. A detailed technical write-up is available in the HackMD advisory and the VulnCheck advisory.

// No verified exploit code is published. The condition is triggered by a crafted
// RLE8 or RLE4 BMP whose final absolute run has an odd pixel count and sits at
// the exact end of the file buffer, causing the decoder to read one byte past
// the allocated region when advancing over the missing pad byte.

Detection Methods for CVE-2026-111138

Indicators of Compromise

  • Unexpected crashes or segmentation faults in applications or browsers that decode BMP images using libnsbmp
  • Core dumps referencing bmp_decode_rle8 or bmp_decode_rle4 call frames
  • Delivery of BMP files with RLE4 or RLE8 compression and truncated or odd-length absolute runs

Detection Strategies

  • Scan software inventories for binaries that statically or dynamically link libnsbmp versions at or below 0.1.7
  • Enable AddressSanitizer (ASan) in fuzzing or test builds to surface the one-byte heap over-read during image parsing
  • Inspect BMP files handled by exposed services for RLE compression headers combined with absolute-run opcodes near end-of-file

Monitoring Recommendations

  • Monitor crash telemetry from image-processing services, previewers, and browsers for repeated faults originating in BMP decode paths
  • Correlate application crashes with recent image downloads or email attachments to identify malicious payloads
  • Log and alert on repeated malformed-image parsing errors from internet-facing services that accept user uploads

How to Mitigate CVE-2026-111138

Immediate Actions Required

  • Identify all deployments of libnsbmp 0.1.7 or earlier across endpoints and application dependencies
  • Restrict applications that process untrusted BMP files to sandboxed or isolated execution contexts
  • Block or filter BMP attachments at email and web gateways while remediation is pending

Patch Information

No fixed release has been published in the data available for this advisory. Monitor the GitHub libnsbmp repository and the NetSurf release downloads for an updated version that corrects bounds checking in bmp_decode_rle8() and bmp_decode_rle4(). Downstream distributions should backport the fix once published upstream. Refer to the VulnCheck advisory for ongoing status.

Workarounds

  • Disable BMP decoding in applications where image format support is configurable
  • Pre-validate BMP files with a hardened parser that enforces word-alignment of RLE absolute runs before passing them to libnsbmp
  • Rebuild libnsbmp with compiler hardening flags such as -fsanitize=address for development and -D_FORTIFY_SOURCE=2 for production to detect or mitigate out-of-bounds reads
bash
# Example: locate binaries linking a vulnerable libnsbmp build
ldconfig -p | grep libnsbmp
find / -type f -name 'libnsbmp*' 2>/dev/null

# Example: rebuild with hardening flags once a patched source is available
CFLAGS="-O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \
  make -C libnsbmp

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.