Skip to main content

Tesseract OCR CVE-2026-119338

| EUVDEUVD-2026-114445 MEDIUM
Out-of-bounds Read (CWE-125)
2026-10-30 GitHub_M
6.9
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit RTL-script (Hebrew/Arabic) page image to OCR service
  2. Delivery
    PAGE XML renderer recognises right-to-left word
  3. Exploit
    AppendLinePolygon double-frees caller-owned Pta accumulator
  4. Execution
    ptaJoin copies stale coordinates into RecalcPolygonline
  5. Impact
    Heap out-of-bounds read / crash (DoS) on affected allocators

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two conditions must both hold. (1) The PAGE XML renderer must be active with polygon output - the shipped defaults page_xml_polygon=true and page_xml_level=0 are sufficient (the guard if (LEVELFLAG > 0 || (POLYGONFLAG && !skewed_flag)) at pagerenderer.cpp:929 is true on an upright page), and PAGE XML is the routine working format of OCR-D and similar digitisation stacks. (2) The input page must contain text recognised with right-to-left writing direction (Hebrew or Arabic); a Latin left-to-right page is a negative control and produces zero errors. Affected versions are 5.4.0-5.5.3 only (the renderer arrived in commit 577e8a8b; 5.3.x and earlier lack it). Limiting factors for defenders: delivery requires an operator/pipeline to process the attacker-supplied document locally (no network, no authentication, passive user interaction), and on glibc the flaw was not shown to progress beyond clean execution - observable corruption/DoS was demonstrated via sanitizer and depends on the allocator (musl, hardened_malloc, Windows debug CRT) or a concurrent multi-threaded OCR service.

Impact

Signals point to a genuine but moderate-priority memory-safety issue rather than an emergency. The vendor CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H, base 6.9) and the vuln.today decision label 'this_month' both place this below act_now/emergency urgency. No CISA KEV listing is present and no EPSS score was supplied, so there is no evidence of active or widespread exploitation. A detailed, deterministic AddressSanitizer reproduction exists in the vendor GHSA advisory, but the advisory itself states that exploitability beyond a crash was NOT demonstrated on glibc - on glibc release builds 50 runs exited cleanly because the freed 200-byte chunk is immediately re-handed to the next ptaCopy and the doubly-freed object is the leaked ptsd copy nothing reads. The real risk lives in the cases the advisory names explicitly: non-glibc allocators (musl, hardened_malloc, Windows debug CRT), long-running multi-threaded OCR services where another thread's allocation lands in the freed chunk between frees, or future builds that remove the leaked ptsd copy. The confirmed observable effect is a heap-buffer-overflow READ in RecalcPolygonline driven by corrupted coordinates (a 250 MB numaCreate followed by an out-of-bounds read), i.e. primarily a denial-of-service/robustness problem on right-to-left pages. Note a tension to verify: the input tags list 'Information Disclosure' and the vector marks VC:L, yet the advisory demonstrates only memory corruption/crash and explicitly declines to claim exploitation - treat confidentiality/code-execution impact as unproven, not confirmed.

Exploit ScenarioDerived

An attacker supplies an ordinary Hebrew or Arabic scanned page image to an OCR pipeline configured to emit PAGE XML with shipped defaults (page_xml_polygon true, page_xml_level 0); no network access or credentials are involved. As each recognised right-to-left word is processed, AppendLinePolygon frees the caller-owned accumulator and later reads and frees the same dangling pointer, producing a deterministic double free / use-after-free and feeding corrupted coordinates into RecalcPolygonline. A public PoC reference exists (the vendor advisory's AddressSanitizer reproduction on a benign Hebrew PNG); it is not verified as working exploit code, and code execution was not demonstrated on glibc.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 30, 2026

Double free and use-after-free in the Tesseract OCR PAGE XML renderer (5.4.0 through 5.5.3) leaves the caller-owned right-to-left line-polygon accumulator (line_top_rtl_pts / line_bottom_rtl_pts) dangling, so a page containing Hebrew or Arabic words makes the renderer free the same heap object once per recognised RTL word and then join stale coordinates into the live line polygon. The bug fires deterministically under AddressSanitizer with the shipped defaults (page_xml_polygon=true, page_xml_level=0; one 1000x220 Hebrew page yields 19 sanitizer errors), and the corrupted extremes have been observed to reach RecalcPolygonline, producing a 250 MB allocation followed by an out-of-bounds read. On glibc release builds the same code executed cleanly for fifty runs, so observable impact depends on allocator behaviour and on concurrent allocation in a long-running multi-threaded OCR service; there is no KEV listing and no confirmed active exploitation, and the upstream advisory's sanitizer reproduction recipe is a public PoC reference that is not verified as working exploit code. Fixed in 5.5.4.

RemediationAI

Vendor-released patch: Tesseract 5.5.4 (https://github.com/tesseract-ocr/tesseract/releases/tag/5.5.4). The fix is carried by PR https://github.com/tesseract-ocr/tesseract/pull/4647 and commit https://github.com/tesseract-ocr/tesseract/commit/fa52414ff1fd13ae4b00048d2498f9141b0bc2eb, which change AppendLinePolygon to take the RTL accumulator as Pta ** so the caller's pointer is updated to a fresh PTA, pass &line_top_rtl_pts and &line_bottom_rtl_pts at the call sites, assign *pts_rtl = ptsd instead of the discarded ptaCopy, and add numaDestroy(&bin_line) plus a regression test (TesseractTest.PAGEXMLRightToLeftPolygon) that renders hebrew.png at page_xml_level 1. Because delivery is a locally processed attacker-supplied image and no patch exists for 5.4.0-5.5.3, interim mitigation is to stop emitting PAGE XML for documents from untrusted sources: if the pipeline uses tessedit_create_page_xml/page output, switch that job to hOCR, TSV or plain text, or run the PAGE XML path in a separate, short-lived, memory-limited worker so a corrupted allocation cannot affect other tenants; note that this keeps the underlying ownership bug in place, so any other consumer of the same process still runs unfixed code, and the release-build behaviour on glibc was benign in testing, meaning a crash-free run does not prove the flaw was not reached. Operators who cannot upgrade should also avoid multi-threaded in-process reuse of a TessBaseAPI across documents, since a concurrent allocation landing between the two frees is the scenario the advisory identifies as the most likely path to observable corruption.

Affected VersionsENISA

tesseract 5.4.0, < 5.5.4

Affected Packages

euvd tesseract fix: 5.5.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The PAGE XML renderer introduced in commit 577e8a8b (PR #4214, April 2024) builds line polygons from Leptonica PTA point arrays. AppendLinePolygon in src/api/pagerenderer.cpp takes the RTL accumulator by value as Pta *pts_rtl; in the right-to-left branch it calls ptaDestroy(&pts_rtl), which frees the allocation and nulls only the callee's local copy, while the caller keeps the now-dangling pointer because neither call site at lines 935 and 937 reassigns it. The same ownership error exists in the left-to-right branch's DestroyAndCreatePta call, whose return value is discarded; the RTL branch also leaks its ptsd copy at line 349 and never actually accumulates RTL word polygons. Both call sites sit inside the guard if (LEVELFLAG > 0 || (POLYGONFLAG && !skewed_flag)) at line 929, which is satisfied by the shipped defaults on an upright page, and end-of-line code at lines 1004-1010 reads the freed struct through ptaGetCount and ptaJoin and frees it again. The primary mapped CWE is CWE-125 (out-of-bounds read), with the advisory also classifying CWE-415 (double free) and CWE-416 (use after free): RecalcPolygonline sizes its bin array from the coordinate range of the polygon it is given, so stale coordinates copied by ptaJoin produced a 250 MB numaCreate and an out-of-bounds access to bin_line->array, which is written directly rather than through numaSetValue and therefore carries no Leptonica bounds check. A Latin left-to-right page is the negative control with zero errors, confirming the RTL branch as the trigger; the assessed vector is local (AV:L) with user interaction (UI:R), no privileges required, and limited confidentiality/integrity plus high availability impact.

Know when Tesseract gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.9 MEDIUM
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
vuln.today AI 6.6 MEDIUM

Attacker supplies a local document an operator processes (AV:L, UI:R, PR:N); the free fires unconditionally on any RTL page (AC:L); confirmed effect is a crash/DoS (A:H) with only unproven, limited C/I impact.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 30, 2026 - 22:03 EUVD
CVE Published
Oct 30, 2026 - 20:12 cve.org
MEDIUM 6.9

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
High
de facto open-source OCR engine, widely embedded but not universal infrastructure
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2022-38266 MEDIUM POC
6.5 Sep 09

An issue in the Leptonica linked library (v1.79.0) allows attackers to cause an arithmetic exception leading to a Denial

CVE-2026-88049 HIGH
8.6 Sep 10

Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who controls a crafted `.traineddata` mod

CVE-2026-88048 HIGH
8.6 Sep 10

Heap out-of-bounds write and read in Tesseract OCR Engine 5.5.3 and earlier allows an attacker who can supply a crafted

CVE-2026-88047 HIGH
8.6 Sep 10

Stack-based buffer overflow in Tesseract OCR 5.5.3 and earlier corrupts the stack during legacy engine initialization, e

CVE-2026-88053 HIGH
8.6 Sep 10

Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who supplies a crafted .traineddata langu

CVE-2026-88051 HIGH
8.6 Sep 10

Heap out-of-bounds write in Tesseract OCR 5.5.3 and earlier allows an attacker who controls the loaded .traineddata mode

CVE-2026-88052 HIGH
7.8 Sep 10

Heap corruption in Tesseract OCR 5.5.3 and earlier allows an attacker who can supply a malicious unicharset file to corr

CVE-2026-88050 MEDIUM
6.9 Sep 10

Out-of-bounds write in Tesseract OCR engine version 5.5.3 and earlier allows an attacker who can supply a crafted `.trai

CVE-2026-88054 MEDIUM
6.9 Sep 10

Denial of service in Tesseract OCR Engine 5.5.3 and earlier allows a local attacker to crash any process that loads a cr

CVE-2026-73066 MEDIUM
6.8 Aug 11

Heap out-of-bounds write in Tesseract OCR engine prior to 5.5.3 is triggered by a crafted LSTM .traineddata model file t

CVE-2026-73067 MEDIUM
6.7 Aug 11

Heap out-of-bounds read in Tesseract OCR prior to version 5.5.3 allows an attacker who can supply a crafted .traineddata

CVE-2026-119339 MEDIUM
5.5 Oct 30

Loading a crafted LSTM model into Tesseract OCR 5.5.3 and earlier aborts the host process on the default build configura

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy