CVE-2026-42440 json
Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader
published 6mo ago modified 5d ago also EUVD-2026-27031 , GHSA-659w-93r5-9j6m
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.6%
- EPSS 0.6% chance of exploitation in 30 days, percentile 49%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- maven org.apache.opennlp:opennlp-tools 1.9.5, 2.5.9, 3.0.0-M3
- Apache Software Foundation Apache OpenNLP 1.9.5, 2.5.9, 3.0.0-M3
- apache-opennlp Debian 14 2.5.9-1
debian advisories DEBIAN-CVE-2026-42440
- opennlp openSUSE Tumbleweed 1.9.5-1.1
opensuse advisories openSUSE-SU-2026:11281-1
- github.com/apache/opennlp@96a073f commit
- github.com/apache/opennlp@fc9824a commit
- github.com/apache/opennlp#1198 pull request
- github.com/apache/opennlp/releases/tag/opennlp-1.9.5 release
- github.com/apache/opennlp/releases/tag/opennlp-2.5.9 release
- github.com/apache/opennlp/releases/tag/opennlp-3.0.0-M3 release
Is CVE-2026-42440 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-42440 updated cvss 7.5
org.apache.opennlp/opennlp-tools: Apache OpenNLP: Denial of Service via unbounded array allocation in crafted model files
-
Red Hat Fuse 7 opennlp-tools, opennlp-maxentaffected: workaround, no fix planned “Will not fix”
-
Red Hat Data Grid 8 opennlp-tools Red Hat JBoss Enterprise Application Platform Expansion Pack opennlp-toolsnot affected: component not present
-
Red Hat OpenShift AI (RHOAI) rhoai/odh-trustyai-service-rhel8, rhoai/odh-trustyai-service-rhel9, rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 6mo ago
Exploit prediction
0.60% chance of exploitation in the next 30 days, higher than 49% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| maven | org.apache.opennlp:opennlp-tools | >=2.0.0, <2.5.9 >=3.0.0-M1, <3.0.0-M3 <1.9.5 |
2.5.9 3.0.0-M3 1.9.5 |
Affected products
- Apache Software Foundation Apache OpenNLP
- Red Hat Red Hat Data Grid 8
- Red Hat Red Hat Fuse 7
- Red Hat Red Hat JBoss Enterprise Application Platform Expansion Pack
- Red Hat Red Hat OpenShift AI (RHOAI)
Classification
References
-
github.com
/apache/opennlp/pull/1198
web
-
github.com
/apache/opennlp/commit/96a073f693f3a0ded808a475f7d7773c072bb8a1
web
-
github.com
/apache/opennlp/commit/fc9824a97709470353add08e44cf15dc08677094
web
-
lists.apache.org
/thread/s8xlkx1gqbxfsq48py5h6jphjvgqp1jo
vendor-advisory, web, mailing-list
-
openwall.com
/lists/oss-security/2026/05/01/21
web, mailing-list, third-party-advisory
-
access.redhat.com
/security/cve/CVE-2026-42440
vdb-entry, web
-
bugzilla.redhat.com
/show_bug.cgi?id=2466494
issue-tracking, web
-
security.access.redhat.com
/data/csaf/v2/vex/2026/cve-2026-42440.json
web
-
nvd.nist.gov
/vuln/detail/CVE-2026-42440
advisory
-
github.com
/apache/opennlp
package
-
github.com
/apache/opennlp/blob/9a0a05466b3e46567e7999272ff72ee37b42976b/SECURITY.md?plain=1#L118
web
-
github.com
/apache/opennlp/releases/tag/opennlp-1.9.5
web
-
github.com
/apache/opennlp/releases/tag/opennlp-2.5.9
web
-
github.com
/apache/opennlp/releases/tag/opennlp-3.0.0-M3
web
Sources
- CVE List CVE-2026-42440
- GitHub Advisory GHSA-659w-93r5-9j6m
- NVD CVE-2026-42440
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.