CVE-2026-119338

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

Published Oct 30, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Tesseract’s AppendLinePolygon function, when invoked on right‑to‑left pages, incorrectly destroys a caller‑owned polygon accumulator by passing it by value. The resulting dangling references are repeatedly read and freed, producing a double free and use after free. This corruption can propagate corrupted polygon coordinates into the RecalcPolygonline routine, causing memory corruption within the OCR engine. The vulnerability does not grant remote code execution directly, but it can lead to crashes, data loss, or unintended behavior in the process using the engine.

Affected Systems

The flaw exists in tesseract‑ocr:tesseract releases from version 5.4.0 through 5.5.4 inclusive. All builds that process right‑to‑left languages such as Hebrew or Arabic and that employ the default PAGE XML level are impacted. The problem was resolved in the 5.5.4 release and later versions.

Risk and Exploitability

The CVSS score of 6.9 indicates a moderately severe vulnerability. EPSS data is not available, and the vulnerability is not listed in CISA’s KEV catalog, suggesting no known active exploits. The attack vector requires an attacker to supply a crafted PAGE XML document that activates the vulnerable code path. Although the path is limited to specific cultural and layout settings, the lack of a public exploit reduces the immediate threat, yet any use of the vulnerable library with uncontrolled XML input warrants containment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Tesseract to version 5.5.4 or later to remove the double free bug
  • If an upgrade cannot be performed immediately, adjust PAGE XML generation for right‑to‑left documents to avoid the POLYGONFLAG false skewed_flag path or ensure LEVELFLAG is set to bypass the vulnerable code block
  • Validate and sanitize PAGE XML input to ensure polygon coordinates are correctly formed before they reach the OCR engine

Generated by OpenCVE AI on October 31, 2026 at 01:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-825
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Tesseract-ocr
Tesseract-ocr tesseract Ocr
Vendors & Products Tesseract-ocr
Tesseract-ocr tesseract Ocr
Type Values Removed Values Added
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.
Title Tesseract: Double free and use after free in the PAGE XML renderer on right-to-left pages
Weaknesses CWE-125
CWE-415
CWE-416
References
Metrics cvssV4_0

{'score': 6.9, '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 5, 2026, 2:41 AM
Reserved
Oct 29, 2026, 8:44 PM
Status
Awaiting Analysis
Published
Oct 30, 2026, 9:16 PM
Modified
Nov 5, 2026, 3:17 AM
Severity
Moderate
Public date
Oct 30, 2026, 8:12 PM