CVE-2026-73066 in Tesseract
Summary
by MITRE • 08/11/2026
Tesseract is an open source OCR engine. Prior to 5.5.3, a crafted .traineddata LSTM model component loaded through Tesseract's deserializer can cause an unchecked signed integer multiplication in Convolve::DeSerialize in src/lstm/convolve.cpp to wrap the convolution output-channel count, undersizing the forward-pass output buffer while writes use the unwrapped element count and causing a heap out-of-bounds write during OCR recognition. This issue is fixed in version 5.5.3.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 08/11/2026
The vulnerability resides within Tesseract's LSTM model deserialization process, specifically in the Convolve::DeSerialize function located in src/lstm/convolve.cpp. This flaw represents a classic integer overflow condition that occurs when processing crafted .traineddata files containing malicious LSTM model components. The issue stems from an unchecked signed integer multiplication operation where the convolution output-channel count becomes wrapped due to arithmetic overflow, leading to a fundamental mismatch between allocated buffer size and actual memory access requirements.
The technical implementation of this vulnerability involves the deserialization of neural network model parameters that define convolutional operations within Tesseract's optical character recognition pipeline. When a maliciously crafted .traineddata file is loaded, the signed integer multiplication in the convolution operation causes the output channel count to wrap around to a much smaller value than originally intended. This wrapping effect results in insufficient memory allocation for the forward-pass output buffer while the actual write operations continue to use the original unwrapped element count, creating a scenario where memory writes exceed allocated bounds.
The operational impact of this heap out-of-bounds write vulnerability is significant as it enables arbitrary code execution or system instability during OCR processing. Attackers can craft malicious .traineddata files that, when processed by vulnerable Tesseract versions, trigger the overflow condition and cause memory corruption. This vulnerability directly relates to CWE-190, which describes integer overflow conditions, and specifically demonstrates how unchecked arithmetic operations can lead to memory safety violations. The attack surface is particularly concerning given that Tesseract's LSTM models are commonly used in document processing applications where users might encounter untrusted input data.
This vulnerability aligns with ATT&CK technique T1203 by enabling adversaries to gain unauthorized code execution through memory corruption attacks, while also mapping to T1557 which involves the manipulation of application data during processing. The flaw demonstrates how improper input validation in machine learning model deserializers can create dangerous conditions for system security. The fix implemented in version 5.5.3 addresses the root cause by properly validating integer multiplication results and ensuring that buffer allocations match actual memory access requirements, thereby preventing the integer wraparound condition that led to heap corruption during OCR recognition operations.
The vulnerability highlights the importance of robust input validation in machine learning frameworks and demonstrates how seemingly benign deserialization processes can become attack vectors when proper arithmetic overflow protections are absent. Security practitioners should consider implementing additional safeguards when processing external model files, including bounds checking on all numeric parameters used for memory allocation decisions. This incident underscores the critical need for comprehensive security testing of AI/ML components in production systems where untrusted data inputs may be processed, particularly in applications that rely on complex neural network architectures and their associated serialization formats.