CVE-2026-88047: Tesseract: ReadNormProtos stack buffer overflow
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, Classify::ReadNormProtos in src/classify/normmatch.cpp parses the NORMPROTO component of a .traineddata file and uses std::istream::operator>>(char) to extract a whitespace-delimited token into a fixed 61-byte stack buffer without setting a stream width. The 100-byte line buffer can carry a token of up to 99 characters, so a token longer than 60 characters writes up to 39 attacker-controlled bytes past the buffer during TessBaseAPI::Init of the legacy engine, causing stack corruption, denial of service, and potentially control-flow hijacking on affected standard-library implementations. Builds using Apple's libc++ C++20 bounded array overload are incidentally protected, while typical libstdc++ builds remain affected. No fixed release is available as of this review.
Affected Software
Event History
Frequently Asked Questions
What must an attacker control to trigger this issue?
An attacker needs to supply or cause the application to load a malicious .traineddata file whose NORMPROTO component contains a whitespace-delimited token longer than 60 characters. The overflow occurs during TessBaseAPI::Init when using the legacy engine.
Are all Tesseract builds affected?
No. Versions 5.5.3 and earlier are affected in typical libstdc++ builds, while builds using Apple's libc++ C++20 bounded array overload are incidentally protected. The issue is tied to parsing legacy-engine traineddata files.
What can be done if no fixed release is available?
Do not load untrusted .traineddata files, and restrict the sources and write access for traineddata assets. Where feasible, use an environment built with Apple's libc++ C++20 bounded array overload, which is described as incidentally protected.
What impact should responders expect from exploitation?
A crafted token can overwrite up to 39 attacker-controlled bytes past the 61-byte stack buffer. This can cause stack corruption and denial of service, with potential control-flow hijacking on affected standard-library implementations.