Skip to main content
← All vulnerabilities
CVE-2026-119338

Tesseract: Double free and use after free in the PAGE XML renderer on right-to-left pages

Affects Tesseract 5.4.0 through 5.5.3 and main at the time, when the PAGE XML renderer processes upright Hebrew or Arabic (right-to-left) pages with default settings. Fixed in 5.5.4.

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Fix
Fixed in 5.5.4
None on Exploit-DB, Metasploit or GitHub

Summary

Tesseract, an open source OCR (optical character recognition) engine, is affected when it generates PAGE XML output for right-to-left text such as Hebrew or Arabic. The flaw can cause memory corruption that may crash the program or produce incorrect text-region coordinates in the output.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

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.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • tesseract-ocr tesseract

    From 5.4.0 · fixed in 5.5.4

References 4

GitHub · tesseract-ocr/tesseract

FAQ

Questions about CVE-2026-119338

What does this mean?

The bug is a double free and a use-after-free on a heap object in the PAGE XML renderer, which corrupts memory. Whether it can be turned into anything more on glibc was not demonstrated, and the outcome depends on the allocator and timing.Source: github.com

Am I affected, and how do I check?

Versions 5.4.0 through 5.5.3 and the main branch at the time are listed as affected. The reported setup is an upright Hebrew or Arabic page processed by the PAGE XML renderer with the shipped defaults (page_xml_polygon true, page_xml_level 0). To check a installation, run tesseract --version for the version and review the page_xml_polygon and page_xml_level settings.Source: github.com

What should I do about it?

Upgrade to Tesseract 5.5.4 or later, which is the first fixed release listed for this product.Source: github.com

Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data