Skip to main content

Leptonica CVE-2026-137063

| EUVDEUVD-2026-135705 MEDIUM
Heap-based Buffer Overflow (CWE-122)
2026-11-25 VulnCheck GHSA-4g5v-hgh8-49r5
6.8
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Local access to file-processing app
  2. Delivery
    Supply >1GB crafted file
  3. Exploit
    Trigger undersized alloc in l_byteaCreate
  4. Execution
    memcpy overruns heap buffer
  5. Impact
    Application crash (denial of service)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

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

Exploitation Conditions

Exploitation requires the target application to process an attacker-supplied input stream/file larger than 1,000,000,000 bytes through Leptonica's l_byteaInitFromStream()/l_byteaCreate() code path (src/bytearray.c). Per the CVSS vector this is a local vector (AV:L) requiring passive user interaction (UI:P) - i.e., a user or application must open/process the oversized file - and no authentication (PR:N). Limiting factors that reduce realistic risk: the attacker must be able to deliver and have processed a file exceeding ~1 GB (which may be blocked by upstream size limits or impractical in many pipelines), the vector is local rather than remote, and the outcome observed in the evidence is a crash (availability only) rather than code execution or data disclosure.

Impact

This is a moderate-severity, availability-only issue, not a top-tier priority. The input CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H) scores it 6.8 and models the realistic case: local attack vector, passive user interaction required, and impact limited to the vulnerable system's availability (VA:H) with no confidentiality or integrity loss. The description and the source-code evidence confirm the mechanism is a crash - l_byteaCreate() allocates a 201-byte buffer while memcpy copies the full (>1,000,000,000-byte) stream size, overrunning the heap. Although CWE-122 heap overflows can sometimes be leveraged beyond a crash, the available evidence only establishes a denial-of-service, and the CVSS scoring reflects that (VC/VI = N). The vuln.today decision label is 'this_month', not act_now or emergency. No KEV listing, no EPSS score, and no verified exploit code were provided, consistent with a non-urgent, non-actively-exploited flaw. The main caveat: the AV:L/UI:P combination means real-world risk depends heavily on whether an application built on Leptonica feeds untrusted, attacker-controlled large files into the l_byteaInitFromStream path - verify exposure against your actual data flow.

Exploit ScenarioDerived

An attacker supplies a crafted or padded file exceeding 1,000,000,000 bytes to an application that uses Leptonica to read it via l_byteaInitFromStream()/l_byteaCreate(). When the stream is processed, a 201-byte heap buffer is allocated but the full billion-plus-byte stream is copied into it, overrunning the heap and crashing the application (denial of service). No public, verified exploit code was identified; exploitation requires local delivery and passive processing of the oversized file (UI:P).

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

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

Alert me

AnalysisAIv1 – Nov 25, 2026

Heap buffer overflow in Leptonica 1.79.0 through 1.87.0 lets an attacker who can get an oversized stream processed by l_byteaInitFromStream() write past a heap allocation and crash the application. The size accounting in l_byteaCreate() under-allocates (observed as a 201-byte buffer) when the incoming stream exceeds roughly 1,000,000,000 bytes, and the subsequent memcpy copies the full stream length, so the demonstrated outcome is an availability impact (crash) rather than code execution or data exposure. Per the assessed vector the attack is local (AV:L) with passive user interaction (UI:P) and no privileges required (PR:N); no public exploit code has been identified at time of analysis, and the issue has not been added to CISA KEV.

RemediationAI

Vendor patch is available: the fix commit c493a776e6bc6cfb1d8d15152a0b74f3d15b33fd (https://github.com/DanBloomberg/leptonica/commit/c493a776e6bc6cfb1d8d15152a0b74f3d15b33fd) adds an nbytes > MaxArraySize check in src/bytearray.c that frees the buffer and returns an error rather than copying; upstream fix available (commit-level), and a released patched version number is not independently confirmed in the supplied data, so consumers should rebuild Leptonica from a revision containing that commit or obtain a vendor build that includes it. Where rebuilding is not immediately possible, enforce a hard input-size cap below the ~1,000,000,000-byte threshold in the layer that hands streams to Leptonica's l_byteaInitFromStream()/l_byteaCreate() path, rejecting oversized files before parsing; the trade-off is that legitimately large images or streams above the cap will be refused, so the limit must be set against actual business input sizes. Priorities follow the this_month decision label: this is a moderate-severity, availability-only issue rather than an emergency, so schedule the rebuild or the input-size guard in the current monthly cycle. Details are also documented at https://www.vulncheck.com/advisories/leptonica-1.79.0-through-1.87.0-heap-buffer-overflow-via-l-byteainitfromstream.

Affected VersionsENISA

Leptonica 1.79.0 ≤1.87.0

Affected Packages

euvd leptonica no fix

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

Leptonica's src/bytearray.c implements L_BYTEA, a growable byte buffer abstraction used by higher-level image and stream parsing routines. CWE-122 (heap-based buffer overflow) arises here because l_byteaInitFromStream() delegates buffer allocation to l_byteaCreate() based on a size value that does not correctly account for very large stream lengths; the allocation observed in the report is 201 bytes while the following memcpy writes the full stream size. The upstream fix commit c493a776e6bc6cfb1d8d15152a0b74f3d15b33fd adds an explicit guard before the copy that rejects any nbytes value greater than MaxArraySize, frees the intermediate data buffer, and returns an ERROR_PTR("stream too large") instead of proceeding. The affected code path is reached only when an application routes an attacker-supplied stream or file through this API, and the trigger requires the input size to exceed approximately 1 GB; the sources do not describe any way to reach the overflow with a smaller payload or via a remote, unauthenticated service interface.

Know when Leptonica 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 (VulnCheck) PRIMARY 6.8 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.5 MEDIUM

Local processing of an attacker-supplied oversized file (AV:L, UI:R) with no auth (PR:N); evidence shows only a crash, so C:N/I:N and A:H.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

Leptonica 1.79.0 through 1.87.0 contains a heap-based buffer overflow vulnerability in l_byteaInitFromStream() that allows attackers to write past a heap buffer by supplying oversized input. Attackers can provide a file larger than 1,000,000,000 bytes, causing l_byteaCreate() to allocate a 201-byte buffer before memcpy copies the full stream size, crashing the application.

Threat Intelligence Overview

EPSS Score
0.2%
Top 91% exploitable
Prevalence
Medium
popular open-source image/OCR library, core dependency of Tesseract OCR
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.2%
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.

A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.

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