Tesseract Model Files Need Bounds and Lifetime Checks
Ubuntu published USN-9221-1 on November 30, 2026 for Tesseract vulnerabilities that can crash the OCR engine when it loads crafted model or template files. The notice covers CVE-2026-119340 and CVE-2026-119341, along with related issues in the same package. The affected Ubuntu releases include 22.04 LTS, 24.04 LTS, and 26.04 LTS, with fixed package versions listed in the notice.
CVE-2026-119340 concerns insufficient validation of matrix dimensions while loading model files. An out-of-bounds memory access can follow, producing a denial of service. CVE-2026-119341 concerns internal data structures initialized from template files. A crafted template can reach a memory-corruption path and terminate the process. These are parser failures, not a claim that an OCR request always yields remote code execution. The immediate risk is service loss or a broken processing queue.
Tesseract is often embedded in document intake, invoice processing, accessibility tooling, and evidence extraction. Those workflows may accept model files from an administrator or a tenant, and they may load a large number of language and template files during a single job. Inventory the model directory, the file ownership, and the process that selects a model for each request. A model path assembled from an untrusted identifier deserves a separate review.
Update Tesseract and its shared libraries to the fixed Ubuntu package versions. Restart the OCR service and verify the version loaded by each worker. If the workflow supports remote model uploads, keep the upload in a quarantine directory, validate the file type and size, and run the parser in a constrained subprocess. Do not use a successful text extraction as proof that an untrusted model is safe.
Build a test corpus with malformed matrix dimensions and template structures. The expected result is a controlled error or process exit that the queue can classify, not an unhandled crash. Set a per-job timeout and a restart budget, and correlate repeated failures with the model hash and uploader. That evidence helps distinguish a bad tenant file from a broader deployment problem.
Trust boundaries around training and recognition assets remain necessary after the fix. OCR models are executable inputs to a complex parser. Treat them with the same ownership, review, and rollback controls as application code, especially in shared pipelines.
References
- Ubuntu USN-9221-1: https://ubuntu.com/security/notices/USN-9221-1
- CVE-2026-119340: https://www.cve.org/CVERecord?id=CVE-2026-119340
- CVE-2026-119341: https://www.cve.org/CVERecord?id=CVE-2026-119341
- Tesseract project: https://github.com/tesseract-ocr/tesseract
Top comments (0)