CVE-2026-119340

Tesseract: GENERIC_2D_ARRAY DeSerializeSize signed integer comparison bypass allows negative dimensions

Published Oct 30, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
Tesseract is an open source OCR engine. Prior to 5.5.4, GENERIC_2D_ARRAY::DeSerializeSize in src/ccstruct/matrix.h reads matrix dimensions as signed int32_t values and compares them only with UINT16_MAX, allowing negative values to reach ResizeNoInit. Negative dimensions or a 65535 by 65535 product can create inconsistent allocation state and later out-of-bounds accesses while loading a crafted traineddata file, causing denial of service. This issue is fixed in version 5.5.4.

Analysis

AI-generated

Technical impact

Tesseract's GENERIC_2D_ARRAY::DeSerializeSize function reads matrix dimensions as signed 32‑bit integers and then compares the value only against UINT16_MAX. This allows a negative number or any value up to 65535 to pass the comparison, which enables the downstream ResizeNoInit builder to allocate memory based on these incorrect dimensions. When a crafted traineddata file is processed, the resulting inconsistent allocation state can cause out‑of‑bounds memory accesses later in the loading pipeline, leading to application crashes and denial of service.

Affected Systems

The vulnerability affects the open‑source OCR engine Tesseract, specifically all releases before version 5.5.4. Users running earlier versions such as 5.5.3, 5.5.2, or older are potentially impacted.

Risk and Exploitability

The CVSS score of 5.5 indicates a moderate risk, and the EPSS score is not currently available. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is an adversary supplying a malicious traineddata file that Tesseract processes, which may occur through local file injection or if the OCR engine is exposed to external data sources. Because the flaw leads only to denial of service rather than arbitrary code execution, the threat surface is limited to availability impact but remains significant for services relying on stable OCR processing.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Tesseract to version 5.5.4 or newer, which includes the fix for the signed integer comparison issue.
  • If an upgrade is not feasible, restrict access to the folder containing traineddata files and ensure only trusted users can place files there, thereby preventing attackers from introducing malicious data.
  • Validate the origin of traineddata files before loading, rejecting any that are not signed or verified by a trusted source.

Generated by OpenCVE AI on October 31, 2026 at 02:35 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': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

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. Prior to 5.5.4, GENERIC_2D_ARRAY::DeSerializeSize in src/ccstruct/matrix.h reads matrix dimensions as signed int32_t values and compares them only with UINT16_MAX, allowing negative values to reach ResizeNoInit. Negative dimensions or a 65535 by 65535 product can create inconsistent allocation state and later out-of-bounds accesses while loading a crafted traineddata file, causing denial of service. This issue is fixed in version 5.5.4.
Title Tesseract: GENERIC_2D_ARRAY DeSerializeSize signed integer comparison bypass allows negative dimensions
Weaknesses CWE-190
CWE-681
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-681

    Incorrect Conversion between Numeric Types

  • CWE-839

    Numeric Range Comparison Without Minimum Check

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 5, 2026, 2:43 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:22 PM