CVE-2026-95516

Description

A flaw was found in the ZBar barcode reader library. A heap-buffer-overflow write of one byte occurs when processing Structured-Append QR codes where the buffer size calculation does not account for NUL separator bytes inserted between decoded segments. An attacker could exploit this by crafting a QR code image that, when scanned by an application using zbar, causes heap corruption leading to a denial of service (application crash).

Statement

This vulnerability is rated as Moderate because a crafted QR image can crash a process using libzbar via a one-byte heap overflow, causing a denial of service. User interaction is required to scan the image. Code execution from a single NUL byte is not a practical concern on modern heap hardening. Red Hat product impact analysis is pending component mapping to determine which products ship the affected zbar code. The vulnerable function is compiled into libzbar whenever QR code support is enabled, which is the default build configuration.

Mitigation

Rebuild zbar with QR code support disabled by passing --enable-codes=ean,databar,code128,code93,code39,codabar,i25,sqcode to configure (omitting qrcode from the list). This removes the vulnerable QR code decoder entirely. Note that this disables all QR code scanning functionality.

Understanding the Weakness (CWE)

Integrity

Technical Impact: Modify Memory; Execute Unauthorized Code or Commands

Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.

Other

Technical Impact: Unexpected State

Subsequent write operations can produce undefined or unexpected results.

Acknowledgements

Red Hat would like to thank Calif.io, in collaboration with Anthropic (Calif.io) for reporting this issue.

Frequently Asked Questions

Want to get errata notifications? Sign up here.