CVE-2026-42440
published 2026-05-04CVE-2026-42440: 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…
PriorityP342high7.5CVSS 3.1
AVNACLPRNUINSUCNINAH
EPSS
0.63%
46.0th percentile
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 be
Affected
9 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| apache | opennlp | < 2.5.9 | 2.5.9 |
| apache | opennlp | — | — |
| apache | opennlp | — | — |
| apache_software_foundation | apache_opennlp | < 1.9.5 | 1.9.5 |
| apache_software_foundation | apache_opennlp | >= 2.0 < 2.5.9 | 2.5.9 |
| apache_software_foundation | apache_opennlp | >= 3.0.0-M1 < 3.0.0-M3 | 3.0.0-M3 |
| rhoai | odh-trustyai-service-rhel8 | — | — |
| rhoai | odh-trustyai-service-rhel9 | — | — |
| rhoai | odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | — | — |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vendor_redhat7.5HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
org.apache.opennlp/opennlp-tools: Apache OpenNLP: Denial of Service via unbounded array allocation in crafted model files
vendor_redhat·2026-05-04·CVSS 7.5
CVE-2026-42440 [HIGH] CWE-770 org.apache.opennlp/opennlp-tools: Apache OpenNLP: Denial of Service via unbounded array allocation in crafted model files
org.apache.opennlp/opennlp-tools: Apache OpenNLP: Denial of Service via unbounded array allocation in crafted model files
A flaw was found in Apache OpenNLP. A remote attacker can exploit this vulnerability by providing a specially crafted binary model (.bin) file. This file contains an excessively large count field, which leads to an unbounded array allocation and triggers an OutOfMemoryError. Successful exploitation results in a Denial of Service (DoS) against any process that attempts to load the malicious model file.
Package: opennlp-tools (Red Hat Data Grid 8) - Under investigation
Package: opennlp-maxent (Red Hat Fuse 7) - Under investigation
Package: opennlp-tools (Red Hat Fuse 7) - Under investigation
Package: opennlp-tools (Red Hat JBoss Enterprise Application Platform Expans
GHSA
Apache OpenNLP AbstractModelReader has an OOM Denial of Service via Unbounded Array Allocation
ghsa·2026-05-04
CVE-2026-42440 [HIGH] CWE-789 Apache OpenNLP AbstractModelReader has an OOM Denial of Service via Unbounded Array Allocation
Apache OpenNLP AbstractModelReader has an OOM Denial of Service via Unbounded Array Allocation
OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader
Versions Affected:
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 I
GHSA
GHSA-659w-93r5-9j6m: OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader
Versions Affected:
before 2
ghsa_unreviewed·2026-05-04
CVE-2026-42440 [HIGH] CWE-789 GHSA-659w-93r5-9j6m: OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader
Versions Affected:
before 2
OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader
Versions Affected:
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 OutOfMemo
VulDB
Apache OpenNLP up to 2.5.8/3.0.0-M2 AbstractModelReader denial of service
vuldb·2026-05-01
CVE-2026-42440 [LOW] Apache OpenNLP up to 2.5.8/3.0.0-M2 AbstractModelReader denial of service
A vulnerability was found in Apache OpenNLP up to 2.5.8/3.0.0-M2. It has been declared as problematic. This affects an unknown function of the component AbstractModelReader. The manipulation results in denial of service.
This vulnerability is identified as CVE-2026-42440. The attack can be executed remotely. There is not any exploit available.
It is recommended to upgrade the affected component.
No detection rules found.
No public exploits indexed.
https://lists.apache.org/thread/s8xlkx1gqbxfsq48py5h6jphjvgqp1johttp://www.openwall.com/lists/oss-security/2026/05/01/21https://access.redhat.com/security/cve/CVE-2026-42440https://bugzilla.redhat.com/show_bug.cgi?id=2466494https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42440.json
2026-05-04
Published