cve.bz

CVE-2026-42440 apache opennlp

7.5 highEPSS 0.6%Fix available

High (7.5) in apache opennlp. EPSS 0.6% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.opennlp:opennlp-tools 1.9.5, 2.5.9, 3.0.0-M3.

On this page
OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader  Versions Affected:  before 1.9.5 before 2.5.9 before 3.0.0-M3  Description: The AbstractModelReader methods getOutcomes(), getOutcomePatterns(), and getPredicates() each read a 32-bit signed integer count field from a binary model stream and pass that value directly to an array allocation (new String[numOutcomes], new int[numOCTypes][], new String[NUM_PREDS]) without validating that the value is non-negative or within a reasonable bound. The count is therefore fully attacker-controlled when the model file originates from an untrusted source. A crafted .bin model file in which any of these count fields is set to Integer.MAX_VALUE (or any value large enough to exhaust the available heap) triggers an OutOfMemoryError at the array allocation itself, before the corresponding label or pattern data is consumed from the stream. The error occurs very early in deserialization: for a GIS model, getOutcomes() is reached after only the model-type string, the correction constant, and the correction parameter have been read; so the attacker pays no meaningful size cost to weaponize a payload, and a single small file can crash a JVM that loads it. Any code path that deserializes a .bin model is affected, including direct use of GenericModelReader and any higher-level component that delegates to it during model load. The practical impact is denial of service against processes that load model files from untrusted or semi-trusted origins.   Mitigation: * 2.x users should upgrade to 2.5.9. * 3.x users should upgrade to 3.0.0-M3. Note: The fix introduces an upper bound on each of the three count fields, checked before array allocation; counts that are negative or exceed the bound cause an IllegalArgumentException to be thrown and the read to fail fast with no large allocation. The default bound is 10,000,000, which is well above the entry counts of legitimate OpenNLP models but far below any value that would threaten heap exhaustion. Deployments that legitimately need to load models with more entries than the default can raise the limit at JVM startup by setting the OPENNLP_MAX_ENTRIES system property to the desired positive integer (e.g. -DOPENNLP_MAX_ENTRIES=50000000); invalid or non-positive values fall back to the default. Users who cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified, and should avoid loading models supplied by end users or fetched from third-party repositories without integrity checks.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.6% (unchanged from 0.6% a week ago; 1.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 49th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2026-05-05. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-789 Memory Allocation with Excessive Size Value
CWE-770 Allocation of Resources Without Limits or Throttling
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-42440 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-42440?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-42440?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-42440 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2026-42440

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2026-42440](https://cve.bz/cve/badge/CVE-2026-42440.svg)](https://cve.bz/cve/CVE-2026-42440)

HTML:

<a href="https://cve.bz/cve/CVE-2026-42440"><img src="https://cve.bz/cve/badge/CVE-2026-42440.svg" alt="CVE-2026-42440"></a>

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Apache Software Foundation Apache OpenNLPfrom 2.0 before 2.5.9
Apache Software Foundation Apache OpenNLPfrom 3.0.0-M1 before 3.0.0-M3
Apache Software Foundation Apache OpenNLPbefore 1.9.5

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-659w-93r5-9j6mMavenorg.apache.opennlp:opennlp-tools>=2.0.0 <2.5.92.5.9
GHSA-659w-93r5-9j6mMavenorg.apache.opennlp:opennlp-tools>=3.0.0-M1 <3.0.0-M33.0.0-M3
GHSA-659w-93r5-9j6mMavenorg.apache.opennlp:opennlp-tools<1.9.51.9.5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13apache-opennlpno fix listedDEBIAN-CVE-2026-42440
Debian14apache-opennlp2.5.9-1DEBIAN-CVE-2026-42440
Ubuntu20.04:LTS, 22.04:LTS, 24.04:LTS and 3 moreapache-opennlpno fix listedUBUNTU-CVE-2026-42440
openSUSETumbleweedopennlp1.9.5-1.1openSUSE-SU-2026:11281-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

Apache's advisory rates this vulnerability Moderate. Red Hat rates it Important (CVSS v3.1 7.5, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). In an affected deployment, a remote unauthenticated attacker can cause a denial of service if the application loads a crafted OpenNLP binary model. An attacker-controlled count can trigger an OutOfMemoryError during model parsing and stop the affected process. The impact is limited to availability; confidentiality and integrity are not affected. Practical exposure depends on whether the application loads models from a source an attacker can control.

Red Hat's mitigation

Until the applicable fix is installed, load OpenNLP binary model files only from trusted sources and verify their provenance and integrity. Do not load models supplied by end users or third-party repositories unless they have been verified. Upstream fixes are available in OpenNLP 2.5.9 or later in the 2.x line and 3.0.0-M3 or later in the 3.x line. For Red Hat products, use the fixed package applicable to the product stream, as Red Hat may backport the fix.

ProductPackageStateAdvisory
Red Hat Data Grid 8opennlp-toolsNot affected
Red Hat Fuse 7opennlp-maxentWill not fix
Red Hat Fuse 7opennlp-toolsWill not fix
Red Hat JBoss Enterprise Application Platform Expansion Packopennlp-toolsNot affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-trustyai-service-rhel8Not affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-trustyai-service-rhel9Not affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-42440.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-770 (20).

References

Check your stackJSON