---
id: "CVE-2026-119341"
kind: "vulnerability"
aliases: ["CVE-2026-119341"]
title: "Tesseract OCR: crafted template file corrupts memory, crashes the engine"
severity: "unknown"
cvss: 0.0
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c++", "ocr", "package", "tesseract"]
not_affected_if: ["default-config", "no-legacy-engine", "untrusted-writes-blocked"]
published_at: "2026-10-30T21:16:52+00:00"
first_seen_at: "2026-10-30T21:25:52+00:00"
updated_at: "2026-10-30T21:27:00+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119341", "first_seen_at": "2026-10-30T21:25:52+00:00"}]
---

# Tesseract OCR: crafted template file corrupts memory, crashes the engine

Tesseract, an open source OCR engine, reads a pre-adapted template (.a) file without validating pointer fields, so a crafted file can trigger invalid memory frees during classification. An attacker who can write that file can cause memory corruption and denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Tesseract version with `tesseract --version`; versions before `5.5.4` are in scope.
- Check whether the legacy engine is used and `classify_use_pre_adapted_templates` is enabled in your configuration.
- Check whether untrusted users can write to the output-basename `.a` file location.

## Fix

- Move to `5.5.4` or later.

## Timeline

- 2026-10-30T21:25:52+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-119341

## From the sources

Tesseract is an open source OCR engine. Prior to 5.5.4, ReadAdaptedClass in src/classify/adaptive.cpp raw-reads an ADAPT_CLASS_STRUCT from a pre-adapted-template .a file without neutralizing TempProtos and Config pointer fields before any destructor path. When the legacy engine is selected, classify_use_pre_adapted_templates is enabled, and an attacker can write the output-basename .a file, the success or rejection path can pass file-controlled pointers to ~ADAPT_CLASS_STRUCT and operator delete, causing memory corruption and denial of service. This issue is fixed in version 5.5.4.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
