ZeroHour

CVE-2026-88052

mass

Heap out-of-bounds write in Tesseract OCR unicharset loading

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

Tesseract OCR 5.5.3 and earlier contains a heap out-of-bounds write in UNICHARSET::load_via_fgets (src/ccutil/unicharset.cpp), which trusts a declared unichar count as a loop bound and uses the resulting id as an unchecked index into the unichars vector. Because unichar_insert_backwards_compatible can leave the vector unchanged for an empty, duplicate, or already-encodable character representation, id can exceed unichars.size(), and the subsequent set_* calls plus the write to unichars[id].properties.enabled store UNICHAR_PROPERTIES data past the end of the vector during initialization — in both the default LSTM engine and the legacy engine. An attacker who can make an application initialize Tesseract from a crafted or corrupted unicharset/traineddata file can crash the process or, potentially, achieve controlled heap corruption, with the CVSS scoring high confidentiality, integrity and availability impact. Anyone running an affected version that loads untrusted OCR data files — desktop OCR tools, server-side document pipelines, and applications embedding the library — is affected. There is no evidence of exploitation: no public proof-of-concept is known and the flaw is not in CISA's KEV, and no fixed release was available as of this review.

What to do: No patched release exists yet, so inventory where Tesseract 5.5.3 or earlier is deployed and identify whether it loads untrusted or third-party traineddata/unicharset files (stock language data from the standard tessdata repositories is not attacker-controlled); restrict OCR processing to trusted language data and monitor the upstream tesseract-ocr repository so you can upgrade to the fixed version as soon as one is published.

Affected
tesseract-ocr (Tesseract OSS project) Tesseract OCR engine5.5.3 and earlier (≤ 5.5.3); no fixed release available as of this review
Estimated exposure
mass≥1,000,000 installations (order of magnitude: millions of endpoints, servers and embedded integrations) — Tesseract is the de facto open-source OCR engine shipped by major Linux distributions and embedded in countless applications, language wrappers and document-management pipelines, so installed bases plausibly exceed one million, though the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Tesseract is an open source OCR engine. In version 5.5.3 and earlier, UNICHARSET::load_via_fgets in src/ccutil/unicharset.cpp trusts the declared unichar count as a loop bound and uses id as an unchecked index into the unichars vector. unichar_insert_backwards_compatible can leave the vector unchanged for an empty, duplicate, or already-encodable representation, causing id to become larger than unichars.size(). Subsequent set_* calls and the write to unichars[id].properties.enabled then write UNICHAR_PROPERTIES beyond the vector during initialization in both the default LSTM and legacy engines, causing heap corruption, a crash, or potentially controlled corruption. No fixed release is available as of this review.

Weakness
CWE-129, CWE-787
Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.