CVE-2026-88050 in Tesseract
Summary
by MITRE • 09/10/2026
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, RecodedCharID::DeSerialize in src/ccutil/unicharcompress.h validates length_ but accepts negative code_ values from a crafted .traineddata recoder component. UnicharCompress::ComputeCodeRange in src/ccutil/unicharcompress.cpp can consequently produce code_range_ equal to zero, after which SetupDecoder indexes is_valid_start_ with the negative code on a size-zero vector. The resulting out-of-bounds bit write uses a large wrapped index and reliably causes a wild-address crash or allocation failure on the default LSTM engine. No fixed release is available as of this review.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 09/10/2026
The Tesseract optical character recognition engine, widely utilized for converting images of text into machine-readable data, contains a critical memory safety vulnerability in versions 5.5.3 and earlier that stems from insufficient input validation within its unichar compression module. The flaw is located specifically in the RecodedCharID::DeSerialize function found in src/ccutil/unicharcompress.h. While this function correctly validates the length_ field of incoming data, it fails to enforce constraints on the code_ value. This oversight allows crafted .traineddata recoder components to supply negative values for code_, which are then processed without adequate boundary checks or type casting safeguards that would typically prevent such invalid states in a secure implementation.
The technical consequence of accepting these negative code_ values manifests during the execution of UnicharCompress::ComputeCodeRange, located in src/ccutil/unicharcompress.cpp. When this function processes the improperly validated input, it can result in the internal variable code_range_ being set to zero. This state is particularly dangerous because it alters the subsequent behavior of the SetupDecoder routine. The decoder attempts to index into the is_valid_start_ vector using the negative code value as an offset. Because the vector size has effectively been reduced or constrained by the prior logic leading to a zero range, accessing this structure with a negative index triggers undefined memory access patterns rather than throwing a standard out-of-bounds exception that could be handled gracefully.
This sequence of events leads directly to an out-of-bounds bit write operation characterized by a large wrapped index due to integer underflow or sign extension issues inherent in how the negative value interacts with unsigned vector indexing mechanisms. The operational impact is severe and immediate, typically resulting in a wild-address crash that causes denial of service for applications relying on Tesseract. In some execution environments, particularly those utilizing memory allocation routines sensitive to such anomalies, this vulnerability can also trigger allocation failures. These crashes are reliable when triggered against the default LSTM engine, making it straightforward for an attacker to disrupt services processing maliciously crafted training data files without requiring complex exploitation techniques beyond file submission or ingestion.
From a classification perspective, this vulnerability aligns with CWE-190 Integer Overflow or Wraparound and CWE-787 Out-of-bounds Write, as the core issue involves improper handling of signed integers leading to invalid memory access. In terms of adversary tactics, this flaw could be leveraged within ATT&CK technique T1496 Resource Hijacking if used for denial of service against OCR services, or potentially T1059 Command and Control if the crash behavior is manipulated in conjunction with other vulnerabilities to achieve arbitrary code execution through heap corruption techniques. The lack of a fixed release as of the review period highlights the urgency for organizations deploying these older versions to implement compensating controls such as input sanitization at the application layer or network-level filtering to block malformed .traineddata files before they reach the Tesseract engine.