CVE-2026-42440: Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader
CVE-2026-42440 key facts
- CISA KEV
- Not listed (catalogue checked )
- Highest advisory rating
- High
- CVSS base score
- 7.5 (Apache), 7.5 (Red Hat)
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H· base score 7.5, scored by CISA-ADPAttack vector: network. Attack complexity: low. Privileges required: none. User interaction: none. Scope: unchanged. Confidentiality impact: none. Integrity impact: none. Availability impact: high.- Weakness
- CWE-789: Memory Allocation with Excessive Size Value
- EPSS
- 0.61% chance of exploitation in the next 30 days (50th percentile). FIRST EPSS, .
- CISA SSVC
- Exploitation: none observed. Automatable: yes. Technical impact: partial. CISA, .
- Fixed releases
- Apache: 2.5.9, 3.0.0-M3, 1.9.5
- Assigned by
- apache (CNA)
- CVE record published
- Listed by VulniPulse
- Record changed
Ratings, versions and fixes are quoted from the vendor advisories that cover only CVE-2026-42440; each belongs to its advisory, not to every product listed. How records are collected and checked.
Am I affected by CVE-2026-42440?
You are affected if you run Apache OpenNLP AbstractModelReader at one of the versions below. If you do, upgrade to the fixed release listed for your version.
| Affected | Fixed in |
|---|---|
| Apache: Apache OpenNLP 2.0 before 2.5.9 | 2.5.9 |
| Apache: Apache OpenNLP 3.0.0-M1 before 3.0.0-M3 | 3.0.0-M3 |
| Apache: Apache OpenNLP before 1.9.5 | 1.9.5 |
Description
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.
Text from the CVE.org record (apache).
How do I fix CVE-2026-42440?
Upgrade to a fixed release named by the vendor:
- Apache: 2.5.9, 3.0.0-M3, 1.9.5
- Mitigation: * 2.x users should upgrade to 2.5.9. * 3.x users should upgrade to 3.0.0-M3. (Apache)
- 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. (Apache)
- Red Hat rates this important; a fix erratum may not be out yet — apply the RHSA as soon as it publishes. (Red Hat)
Vendor advisories for CVE-2026-42440
Apache
1 advisory- Advisory severityHigh7.5
High [CVE-2026-42440] Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader
CVE-2026-42440Source published Source updated
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…
- Affected products in this advisory
- Apache OpenNLP AbstractModelReader
- Source-reported affected versions
- Apache OpenNLP 2.0 before 2.5.9
- Apache OpenNLP 3.0.0-M1 before 3.0.0-M3
- Apache OpenNLP before 1.9.5
- Source-reported fixed versions
- 2.5.9
- 3.0.0-M3
- 1.9.5
- Mitigation guidance
- Mitigation: * 2.x users should upgrade to 2.5.9. * 3.x users should upgrade to 3.0.0-M3.
- 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.
Red Hat
1 advisory- Advisory severityHigh7.5
High [CVE-2026-42440] Denial of Service via unbounded array allocation in crafted model files
CVE-2026-42440Source published
Denial of Service via unbounded array allocation in crafted model files. Red Hat rates this important (CVSS 7.5). Weakness: CWE-770. No fix erratum has been published yet; monitor the Red Hat CVE page and apply the RHSA when released.
- Affected products in this advisory
- Red Hat Fuse 7
- Red Hat JBoss Enterprise Application Platform Expansion Pack
- Source-reported affected versions
- Affected-version details not available in this record.
- Source-reported fixed versions
- No fixed-version detail extracted. This does not mean no fix exists.
- Mitigation guidance
- Red Hat rates this important; a fix erratum may not be out yet — apply the RHSA as soon as it publishes.
References
- CVE-2026-42440 recordCVE.org
- CVE-2026-42440 detailNVD
- lists.apache.org/thread/s8xlkx1gqbxfsq48py5h6jphjvgqp1jovendor-advisory
Timeline
- First vendor advisory listed by VulniPulse
- CVE record published
- CVE record last updated
More Apache advisories
CVE-2026-137442Dec 3, 2026Apache OFBiz: Direct Request in Order Confirmation EmailCVE-2026-136829Dec 3, 2026Apache OFBiz: Use of Non-Canonical URL Paths in Password-Reset SessionsCVE-2026-136828Dec 3, 2026Apache OFBiz: Authorization Bypass Through User-Controlled Key in Work Effort AssociationsCVE-2026-136827Dec 3, 2026Apache OFBiz: Direct Request in Manufacturing Production Run ServicesCVE-2026-136826Dec 3, 2026Apache OFBiz: Direct Request in Order Requirement ServicesCVE-2026-136820Dec 3, 2026Apache OFBiz: Direct Request in Customer Request Services
Get an email when Apache publishes the next one.
See Apache's last 90 days first. Live alerts for one product are free for life; every vendor is US$10 a month with Pro (first month US$5).