ZeroHour

CVE-2026-88049

mass

Heap out-of-bounds write in Tesseract OCR LSTM engine

CVSS 4.0
8.6 high
EPSS
Published
()
Modified
AI analysis

Tesseract OCR versions 5.5.3 and earlier contain a heap out-of-bounds write (CWE-787) in the LSTM recognition path: while earlier hardening added bounds checks to NetworkIO::CopyTimeStepGeneral and NetworkIO::Randomize, the NetworkIO::WriteTimeStepPart and NetworkIO::AddTimeStepPart functions in src/lstm/networkio.cpp remained unchecked. The flaw is triggered when the default LSTM engine processes a specially crafted .traineddata model file: in LSTM::Forward (src/lstm/lstm.cpp) the source_ buffer is sized from the independently deserialized na_ field, but WriteTimeStepPart writes a count driven by ns_ from the CI gate WeightMatrix dim1() value, so a crafted NT_LSTM layer with ns_ much larger than na_ overruns the heap buffer during the first recognition step. An attacker who can get such a model file processed gains heap corruption, causing a crash or potentially controlled memory corruption; CVSS 4.0 rates this 8.6 High with a local attack vector and no privileges or user interaction required. Anyone running Tesseract 5.5.3 or earlier is affected in principle, with practical risk concentrated in applications and pipelines that load third-party or otherwise untrusted .traineddata language models rather than only official trusted ones. No public proof-of-concept or in-the-wild exploitation is known, the flaw is not in CISA KEV, and no fixed release was available at the time of review.

What to do: No fixed Tesseract release is available yet, so monitor the project for a patched version and upgrade as soon as one ships. Until then, avoid loading .traineddata files from untrusted or third-party sources on affected builds, verify the provenance and integrity of any externally sourced language models, and consider running OCR of external models in sandboxed, low-privilege workers to limit impact of a crash or heap corruption.

Affected
Tesseract (open source project) Tesseract OCR engine (tesseract CLI / libtesseract)5.5.3 and all earlier versions; no fixed release available at time of review
Estimated exposure
massmillions of installations worldwide (Tesseract is the dominant open-source OCR engine, bundled in major Linux distributions and embedded in a large ecosystem… — Estimated from deployment patterns: Tesseract is the de facto open-source OCR standard shipped by Linux distributions and consumed via many downstream apps and bindings, giving an ecosystem install base well above 1M, with 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, prior .traineddata hardening added bounds checks to NetworkIO::CopyTimeStepGeneral and NetworkIO::Randomize in src/lstm/networkio.cpp but left NetworkIO::WriteTimeStepPart and NetworkIO::AddTimeStepPart unchecked. In LSTM::Forward in src/lstm/lstm.cpp, source_ is sized from the independently deserialized na_ field while the WriteTimeStepPart count is ns_, which comes from the CI gate WeightMatrix dim1() value. A crafted NT_LSTM layer can make ns_ much larger than na_, causing a heap out-of-bounds write during the first recognition step on the default LSTM engine and resulting in heap corruption, a crash, or potentially controlled corruption. No fixed release is available as of this review.

Vendors
tesseract-ocr
Products
tesseract ocr
Weakness
CWE-787
Vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.