---
id: "CVE-2026-119338"
kind: "vulnerability"
aliases: ["CVE-2026-119338"]
title: "Tesseract OCR: crafted Hebrew or Arabic page triggers memory corruption"
severity: "medium"
cvss: 6.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["document-processing", "ocr", "package", "self-hosted", "tesseract"]
not_affected_if: ["latin-script-only", "plain-text-output", "versions-5.5.4-and-above", "versions-below-5.4.0"]
published_at: "2026-10-30T21:16:51+00:00"
first_seen_at: "2026-10-30T21:25:52+00:00"
updated_at: "2026-10-30T21:26:47+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119338", "first_seen_at": "2026-10-30T21:25:52+00:00"}]
---

# Tesseract OCR: crafted Hebrew or Arabic page triggers memory corruption

Tesseract is an open source OCR engine used to read text from images. A crafted upright Hebrew or Arabic page can trigger a double free and use after free during PAGE XML output, which can corrupt memory and may let an attacker run code.

_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 from 5.4.0 up to but not including 5.5.4 are affected.
- Check whether your pipeline runs Tesseract with PAGE XML output (the POLYGONFLAG or LEVELFLAG settings) on right-to-left Hebrew or Arabic pages.

## Fix

- Tesseract: upgrade to `5.5.4`

## Timeline

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

## From the sources

Tesseract is an open source OCR engine. From 5.4.0 until 5.5.4, AppendLinePolygon in src/api/pagerenderer.cpp destroys the caller-owned right-to-left Pta accumulator while receiving it by value, leaving line_top_rtl_pts and line_bottom_rtl_pts dangling. On an upright Hebrew or Arabic page at the default PAGE XML level, POLYGONFLAG with a false skewed_flag enters the vulnerable calls, while LEVELFLAG greater than zero provides an alternative gate. The calls repeatedly read and free the stale object, causing a double free and use after free and allowing corrupted coordinates to reach RecalcPolygonline. 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_
