CVE-2026-88051: Tesseract: Heap out-of-bounds write in GenericVector<T>::read due to independent reserved/size_used_ fields
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, the callback form of GenericVector::read in src/ccutil/genericvector.h reads the independent int32 fields reserved and sizeused from a .traineddata model without a cap or an invariant check. reserve(reserved) allocates the backing array, but the callback loop writes sizeused elements. A crafted TESSDATAINTTEMP component with versionid 4 or later can therefore set reserved to a small value and sizeused to a large value when fontinfotable.read(fp, readinfo) is called from src/classify/intproto.cpp, causing a heap out-of-bounds write of FontInfo structures, heap corruption, a crash, or potentially controlled corruption. No fixed release is available as of this review.
Affected Software
Event History
Frequently Asked Questions
What does an attacker need to provide to trigger this issue?
The attacker needs to supply a crafted TESSDATA_INTTEMP component in a .traineddata model with version_id 4 or later. The component must set reserved to a small value and size_used_ to a larger value.
Which deployments are exposed?
Tesseract version 5.5.3 and earlier is affected when it reads a crafted model through the affected fontinfo_table_.read path. The available data does not state whether any particular default model or configuration contains the malicious values.
What can be done while no fixed release is available?
Do not load .traineddata models or TESSDATA_INTTEMP components from untrusted sources. Restrict model updates and distribution to trusted, validated artifacts.
How can a model be identified as suspicious?
Inspect TESSDATA_INTTEMP components with version_id 4 or later for inconsistent GenericVector metadata where size_used_ exceeds reserved. That mismatch can cause writes beyond the allocation when the font information table is read.