On this page (7 sections)

On 30 November 2026 Ubuntu published USN-9221-1, covering four vulnerabilities in Tesseract, the open source OCR engine. Ubuntu summarizes the impact as Tesseract being made to crash when it opens a specially crafted file. All four are described as denial of service issues, and two of them mention memory corruption or out-of-bounds access.

If your servers run Tesseract to read text from uploaded images, scanned documents or invoices, this applies to you. Even if you never installed it directly, other packages may pull it in, so it is worth a quick check.

What Ubuntu fixed

The notice bundles four separate flaws. Which ones affect you depends on your Ubuntu release, according to Ubuntu's notice:

Tesseract CVEs in USN-9221-1
CVEWhat Ubuntu saysUbuntu releases
CVE-2021-36081Use-after-free in internal string handling during character recognition; denial of service22.04 LTS only
CVE-2026-119339Model file with unsupported weight matrix format makes Tesseract abort; denial of service24.04 LTS and 26.04 LTS only
CVE-2026-119340Matrix dimensions not validated when loading model files; out-of-bounds memory access; denial of service22.04, 24.04 and 26.04 LTS
CVE-2026-119341Internal data structures not initialized when loading template files; memory corruption; denial of serviceNot restricted to specific releases in the notice

Technical details in plain terms

Three of the four issues involve Tesseract loading data it trusts too much. A traineddata file is the model Tesseract uses to recognize text. If the loader believes values stored inside that file without checking them, a crafted file can push the program into a bad state.

  • CVE-2026-119339 (CVSS 5.5, medium): per the upstream advisory text in the CVE record, versions before 5.5.4 read a mode byte from an LSTM network model and, in default FAST_FLOAT builds, hit an assertion instead of returning an error. Loading a crafted model terminates the process. The weakness classes are CWE-20 (improper input validation) and CWE-617 (reachable assertion).
  • CVE-2026-119340 (CVSS 5.5, medium): matrix dimensions are read as signed 32-bit values and compared only against a 16-bit maximum, so negative values or a 65535 by 65535 product can lead to inconsistent allocation and later out-of-bounds access. Fixed in 5.5.4 according to the advisory. The weaknesses are CWE-190 and CWE-681 (integer overflow and incorrect numeric conversion).
  • CVE-2021-36081 (CVSS 7.8, high): a use-after-free in a function called one_ell_conflict, found in 5.0.0-alpha-20201231. The GitHub advisory lists a local attack vector with user interaction required, and an EPSS score of 0.89%. It is an older flaw that Ubuntu now covers for 22.04.
  • CVE-2026-119341: described only in Ubuntu's notice (uninitialized structures when loading template files). The research I reviewed contains no CVSS score or upstream record for it, so treat its severity as unconfirmed.

The 7.8 score for the 2021 flaw reflects the worst-case impact in the CVSS model (confidentiality, integrity and availability all rated high). Ubuntu itself describes the practical result as a crash and denial of service.

Who is realistically exposed

The attack needs Tesseract to open a malicious file. That makes these flaws most relevant where Tesseract processes content you do not control:

  • Web applications that OCR user uploads, such as invoice, ID or document scanning features.
  • Back-office pipelines that ingest scanned mail or PDFs from outside parties.
  • Shared servers where other users can supply model (traineddata) or template files.
  • Build or automation hosts that run OCR on downloaded files.

If Tesseract is installed but only ever runs on files you created yourself with models you downloaded from a trusted source, your exposure is low. A crash in a worker process can still be annoying, for example if it stalls a queue, but the sources describe denial of service, not remote code execution. Ubuntu's notice does not say the memory corruption issue is exploitable beyond a crash.

How to check if you are affected

Run this on each Ubuntu host to list installed Tesseract packages and their versions. No output means the packages are not installed:

List installed Tesseract packages and versions (Ubuntu)Shell
dpkg -l | grep -i tesseract

Compare the versions to the fixed ones in the table below. If your version is older than the listed one, the fix is not yet applied.

Fixed package versions from USN-9221-1 (via Ubuntu Pro ESM Apps)
Ubuntu releasePackagesFixed version
26.04 LTSlibtesseract5, tesseract-ocr5.5.0-1ubuntu0.1~esm2
24.04 LTSlibtesseract5, tesseract-ocr5.3.4-1ubuntu0.1~esm2
22.04 LTSlibtesseract4, tesseract-ocr4.1.1-2.1ubuntu0.1~esm2

To find out which installed packages depend on the library, query reverse dependencies. This is read-only and shows what could be calling Tesseract indirectly:

Show packages that depend on tesseract-ocr (Ubuntu, read-only)Shell
apt-cache rdepends --installed tesseract-ocr

What to do now

Ubuntu states the fixes are available through Ubuntu Pro via ESM Apps, and that a community fix might become public in the future. The notice also says Ubuntu Pro is free for up to five machines. If a machine is not attached to Ubuntu Pro, the standard update will not deliver these versions.

  1. Run the dpkg check above on every Ubuntu 22.04, 24.04 and 26.04 host and note where Tesseract is installed.
  2. Decide which hosts process files from untrusted sources and prioritize them.
  3. Attach those hosts to Ubuntu Pro if they are not already, and make sure ESM Apps is enabled.
  4. Run a standard system update, then re-run the dpkg check to confirm the fixed version.
  5. Restart services or workers that use Tesseract so they load the updated library.
  6. Until patched, restrict who can upload or supply traineddata and template files, and do not load models from unknown sources.
  7. Run OCR jobs with timeouts and automatic restarts so a crashing worker cannot take down a whole service.

Ubuntu says a normal update applies the fixes once the system can receive them. On Debian-based hosts, this updates only the Tesseract packages:

Update only the Tesseract packages (Ubuntu, run as root or with sudo)Shell
sudo apt update && sudo apt install --only-upgrade tesseract-ocr
Caution. Restarting an application server or worker pool interrupts requests that are in progress. Do it in a maintenance window or one node at a time.
If you compile Tesseract yourself or bundle it in a container, the distribution update does not help. Upstream says CVE-2026-119339 and CVE-2026-119340 are fixed in Tesseract 5.5.4. The research does not state a fixed upstream version for CVE-2026-119341, so check upstream release notes for it.

Detection and monitoring

Exploitation of these flaws looks like crashes rather than a break-in, so watch for repeated failures of OCR processes. Look for unexpected exits, segmentation faults or aborts in the logs of the services that call Tesseract, and correlate them with specific uploaded files. A burst of crashes tied to one source is a reason to quarantine the files and review who submitted them.

For web applications that accept uploads, also review upload limits and file type checks, and keep the OCR step isolated from the rest of the application, for example in a separate low-privilege process or container. For broader guidance on keeping servers current, see the small business website security guide. If you run public sites on these servers, a regular security scan and uptime monitoring help you notice when a crashing component affects availability.

What is still unclear

  • Ubuntu gives no overall severity rating for USN-9221-1.
  • No CVSS score for CVE-2026-119341 appears in the research.
  • The sources do not report any exploitation in the wild, and none of the CVE records lists a CISA KEV entry. That is not proof that nobody has tried.
  • Ubuntu's notice does not say whether Debian or other distributions have shipped fixes, so check your own vendor.

Sources

This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.

  1. CVE-2021-36081 - GitHub Advisory Databasegithub.com
  2. USN-9221-1: Tesseract vulnerabilities | Ubuntu security notices | Ubuntuubuntu.com ·
  • Ubuntu
  • Tesseract
  • OCR
  • USN
  • denial of service