CVE-2026-88053: Tesseract: Heap out-of-bounds write in Classify::ReadIntTemplates via unvalidated counts in crafted .traineddata
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, Classify::ReadIntTemplates in src/classify/intproto.cpp reads NumClassPruners, NumClasses, and NumProtoSets from the TESSDATAINTTEMP component of a crafted .traineddata file and uses those values as loop bounds without validating them against MAXNUMCLASSPRUNERS, MAXNUMCLASSES, and MAXNUMPROTOSETS. The loops store heap pointers into fixed-capacity ClassPruners and ProtoSets arrays in INTTEMPLATESSTRUCT and INTCLASSSTRUCT, so an oversized count causes heap out-of-bounds pointer writes during legacy-classifier initialization before OCR begins, resulting in heap corruption, a crash, or potentially controlled corruption. No fixed release is available as of this review.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Deployments that initialize Tesseract's legacy classifier using a crafted or untrusted .traineddata file are exposed. The out-of-bounds writes occur while loading the TESSDATA_INTTEMP component, before OCR processing begins.
What must an attacker provide to trigger the vulnerability?
An attacker needs to cause Tesseract to load a crafted .traineddata file whose TESSDATA_INTTEMP component contains oversized NumClassPruners, NumClasses, or NumProtoSets values. Those values are used as loop bounds without validation against the corresponding maximum limits.
Is a fixed version available?
No fixed release was available as of the review date. The affected versions are 5.5.3 and earlier.
What can be done if patching is not immediately possible?
Do not load untrusted .traineddata files. Restrict the model-data sources and file paths available to OCR workloads so that only known, trusted traineddata files can be used.