CVE-2026-88048: Tesseract: Heap out-of-bounds write/read in FullyConnected::Forward via layer/weight-matrix dimension mismatch
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, FullyConnected::DeSerialize in src/lstm/fullyconnected.cpp does not validate the deserialized layer scalars ni and no against the weight-matrix dimensions. During FullyConnected::Forward, MatrixDotVector in src/lstm/weightmatrix.cpp writes w.dim1() results into templine, which is sized from no, and reads w.dim2() minus one inputs from currinput, which is sized from ni. A crafted .traineddata NTSOFTMAX layer can therefore use inconsistent dimensions to cause a heap out-of-bounds write and read on the default LSTM engine, resulting in heap corruption, a crash, information disclosure, or potentially controlled corruption. No fixed release is available as of this review.
Affected Software
Event History
Frequently Asked Questions
What attacker-controlled input is required to trigger this issue?
An attacker needs to provide a crafted .traineddata file containing an NT_SOFTMAX layer whose serialized ni_ and no_ scalars are inconsistent with the weight-matrix dimensions. The vulnerable deserialization accepts those inconsistent dimensions, and processing the layer through the default LSTM engine reaches the out-of-bounds operations.
Are default Tesseract deployments affected?
The issue affects the default LSTM engine when it processes a malicious .traineddata NT_SOFTMAX layer. It is present in Tesseract version 5.5.3 and earlier.
What is the impact if exploitation succeeds?
The dimension mismatch can cause both heap out-of-bounds writes and reads. Reported consequences include heap corruption, crashes, information disclosure, and potentially controlled memory corruption.
Is a fixed version available?
No fixed release was available as of the review. The provided references include a commit associated with the issue.