---
id: "CVE-2026-121942"
kind: "vulnerability"
aliases: ["CVE-2026-121942"]
title: "ZBar: crafted SQ code image reads heap memory out of bounds"
severity: "medium"
cvss: 6.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["barcode-scanning", "c-library", "package", "zbar"]
not_affected_if: ["no-sq-code-decoding", "trusted-input-only"]
published_at: "2026-11-04T13:17:28+00:00"
first_seen_at: "2026-11-04T13:27:03+00:00"
updated_at: "2026-11-04T13:28:05+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-121942", "first_seen_at": "2026-11-04T13:27:03+00:00"}]
---

# ZBar: crafted SQ code image reads heap memory out of bounds

ZBar is a barcode-reading library, and a crafted SQ code image with a skewed finder pattern near the edge makes its decoder read past the image buffer. An attacker can crash the decoder and leak heap bytes into the decoded output.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the `zbar` library or a binary built on it is present, for example with `zbarimg --version` or by searching the dependency tree for `zbar`.
- Confirm the version is `0.23.95` or earlier, the range the sources name as affected.

## Timeline

- 2026-11-04T13:27:03+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-121942

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/zbar-through-0.23.95-out-of-bounds-read-via-zbar-sq-decode-in-sqcode-c

## From the sources

ZBar through 0.23.95 contains an out-of-bounds read vulnerability in _zbar_sq_decode() in zbar/sqcode.c that allows attackers to read heap memory outside the image buffer via crafted SQ code images. Attackers can supply an image with a skewed SQ code finder pattern near the edge, producing unchecked sample coordinates that crash the decoder and leak bytes into output.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
