Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft .traineddata with oversized CI gate dim1 (ns_ >> na_)
-
DeliveryDeliver crafted file to Tesseract model-loading path
-
ExploitLSTM::DeSerialize loads inconsistent na_/ns_ without cross-validation
-
ExecutionLSTM::Forward allocates source_ buffer sized by na_
-
PersistWriteTimeStepPart writes ns_ floats past buffer end
-
ImpactHeap corruption causes crash or controlled code execution
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the attacker to supply or substitute a crafted |
| Impact | The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N with VC:H/VI:H/VA:H) scores 8.6, reflecting a locally-delivered attack with no privileges or user interaction required beyond the normal invocation of Tesseract with a model file. The local attack vector correctly limits scope to environments where an attacker can supply or replace a |
| Exploit ScenarioDerived | An attacker operating a document processing service that accepts user-specified language model files uploads a crafted |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 10, 2026
Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who controls a crafted .traineddata model file to corrupt heap memory during LSTM inference, leading to a crash or potentially controlled code execution. The root cause is an inconsistency between source_ (sized from deserialized na_) and the write count used by WriteTimeStepPart and AddTimeStepPart (driven by ns_ from the CI gate WeightMatrix dim1), leaving two functions unbounded after prior hardening patched sibling routines. No fixed release is available at time of analysis; an upstream fix exists only as a commit. No public exploit identified at time of analysis.
RemediationAI
No vendor-released patch is available at time of analysis. An upstream fix is present in commit b494ac18925f9d9aff9ef5815475de9943ab19bf (https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf); operators who build Tesseract from source should apply this commit or build from HEAD. As compensating controls: restrict Tesseract model loading exclusively to internally-managed, pre-validated .traineddata files and reject any user-supplied model input at the application boundary - this eliminates the attack surface for external attackers entirely. Where model-file provenance cannot be guaranteed, run Tesseract in an isolated process or container with a restrictive seccomp profile and no write access to sensitive paths, so that heap corruption cannot escalate beyond the sandboxed process. Monitor the upstream repository for the next tagged release incorporating this fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Tesseract's LSTM engine deserializes neural network models from .traineddata files into C++ objects in src/lstm/lstm.cpp. During LSTM::Forward, the scratch buffer source_ is allocated using na_ (the activation-count field read directly from the serialized header), while WriteTimeStepPart and AddTimeStepPart in src/lstm/networkio.cpp write ns_ elements, where ns_ is derived from the deserialized CI gate WeightMatrix's Dim1() value. Because these two fields are deserialized independently with no cross-validation, a crafted NT_LSTM layer can set gate matrix dimensions to make ns_ arbitrarily larger than na_. This triggers a heap write past the end of source_ on the very first recognition step (CWE-787: Out-of-bounds Write). The fix in commit b494ac18 adds dimension-consistency checks to LSTM::DeSerialize and bounds assertions (ASSERT_HOST) to NetworkIO::AddTimeStep and NetworkIO::WriteTimeStep. Affected CPE: cpe:2.3:a:tesseract-ocr:tesseract:*:*:*:*:*:*:*:* (all versions through 5.5.3).
Know when Tesseract gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Crafted .traineddata requires local file delivery (AV:L) but no privileges or interaction; heap OOB write can corrupt full process memory affecting all CIA triad.
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
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.
Technical POC Analysis
CWE-787 (Out-of-bounds Write) in the LSTM inference path of libtesseract.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
Tesseract OCR versions 5.5.3 and earlier contain a heap memory corruption vulnerability exploitable through malicious OCR model files, potentially enabling code execution on document processing systems. Organizations using Tesseract for batch document processing, form automation, or digitization services face compromise risk if untrusted .traineddata model files enter processing pipelines.
No vendor-released patch identified at time of analysis. Implement interim mitigations: (1) cryptographically validate all .traineddata files against known-good signatures or hashes before processing; (2) execute OCR processes in sandboxed containers with restricted file system and network access; (3) enforce whitelist of approved, internally-maintained model file versions; (4) disable untrusted external model file uploads and consider disabling OCR entirely for external content sources if operationally feasible.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
An issue in the Leptonica linked library (v1.79.0) allows attackers to cause an arithmetic exception leading to a Denial
Heap out-of-bounds write and read in Tesseract OCR Engine 5.5.3 and earlier allows an attacker who can supply a crafted
Stack-based buffer overflow in Tesseract OCR 5.5.3 and earlier corrupts the stack during legacy engine initialization, e
Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who supplies a crafted .traineddata langu
Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who controls the loaded .traineddata mode
Heap corruption in Tesseract OCR 5.5.3 and earlier allows an attacker who can supply a malicious unicharset file to corr
Out-of-bounds write in Tesseract OCR engine version 5.5.3 and earlier allows an attacker who can supply a crafted `.trai
Denial of service in Tesseract OCR Engine 5.5.3 and earlier allows a local attacker to crash any process that loads a cr
Double free and use-after-free in the Tesseract OCR PAGE XML renderer (5.4.0 through 5.5.3) leaves the caller-owned righ
Heap out-of-bounds write in Tesseract OCR engine prior to 5.5.3 is triggered by a crafted LSTM .traineddata model file t
Heap out-of-bounds read in Tesseract OCR prior to version 5.5.3 allows an attacker who can supply a crafted .traineddata
Loading a crafted LSTM model into Tesseract OCR 5.5.3 and earlier aborts the host process on the default build configura
Same weakness CWE-787 – Out-of-bounds Write
View allSame technique Buffer Overflow
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Module for Package Hub 15 SP7 | Affected |
EUVD-2026-75592
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB