CVE-2026-42440: CWE-789: Memory Allocation with Excessive Size Value in Apache Software Foundation Apache OpenNLP
CVE-2026-42440 is a high-severity vulnerability in Apache OpenNLP versions before 2.5.9 and before 3.0.0-M3. It involves unbounded memory allocation during deserialization of . bin model files, where attacker-controlled count fields are used directly to allocate arrays without validation. This can cause an OutOfMemoryError and crash the Java Virtual Machine loading the model, resulting in a denial of service. The issue affects any code path that loads . bin models from untrusted sources.
AI Analysis
Technical Summary
The vulnerability arises from AbstractModelReader methods (getOutcomes(), getOutcomePatterns(), getPredicates()) reading 32-bit signed integer counts from a binary model stream and using these values directly for array allocations without validating their size or sign. An attacker can craft a .bin model file with extremely large count values (e.g., Integer.MAX_VALUE) to trigger an OutOfMemoryError early in deserialization, causing denial of service. The flaw affects Apache OpenNLP versions before 2.5.9 and 3.0.0-M3. The fix introduces an upper bound (default 10,000,000) on these counts, throwing an IllegalArgumentException if exceeded, preventing large allocations. Users can configure this limit via the OPENNLP_MAX_ENTRIES system property if needed.
Potential Impact
This vulnerability allows an attacker to cause a denial of service by crashing the JVM process that loads a maliciously crafted .bin model file. There is no impact on confidentiality or integrity, only availability is affected. The denial of service occurs early in the model deserialization process and can be triggered by a small crafted file, making it practical for attackers to disrupt services that load untrusted or semi-trusted models.
Mitigation Recommendations
Fixed versions are available: users of Apache OpenNLP 2.x should upgrade to version 2.5.9 or later, and users of 3.x should upgrade to 3.0.0-M3 or later. The fix enforces upper bounds on array allocation sizes to prevent heap exhaustion. Deployments that cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified and avoid loading models from untrusted or third-party sources without integrity checks. The vendor advisory does not indicate any temporary fixes or that no action is required.
CVE-2026-42440: CWE-789: Memory Allocation with Excessive Size Value in Apache Software Foundation Apache OpenNLP
Description
CVE-2026-42440 is a high-severity vulnerability in Apache OpenNLP versions before 2.5.9 and before 3.0.0-M3. It involves unbounded memory allocation during deserialization of . bin model files, where attacker-controlled count fields are used directly to allocate arrays without validation. This can cause an OutOfMemoryError and crash the Java Virtual Machine loading the model, resulting in a denial of service. The issue affects any code path that loads . bin models from untrusted sources.
CVSS v3.1
Score 7.5high
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from AbstractModelReader methods (getOutcomes(), getOutcomePatterns(), getPredicates()) reading 32-bit signed integer counts from a binary model stream and using these values directly for array allocations without validating their size or sign. An attacker can craft a .bin model file with extremely large count values (e.g., Integer.MAX_VALUE) to trigger an OutOfMemoryError early in deserialization, causing denial of service. The flaw affects Apache OpenNLP versions before 2.5.9 and 3.0.0-M3. The fix introduces an upper bound (default 10,000,000) on these counts, throwing an IllegalArgumentException if exceeded, preventing large allocations. Users can configure this limit via the OPENNLP_MAX_ENTRIES system property if needed.
Potential Impact
This vulnerability allows an attacker to cause a denial of service by crashing the JVM process that loads a maliciously crafted .bin model file. There is no impact on confidentiality or integrity, only availability is affected. The denial of service occurs early in the model deserialization process and can be triggered by a small crafted file, making it practical for attackers to disrupt services that load untrusted or semi-trusted models.
Mitigation Recommendations
Fixed versions are available: users of Apache OpenNLP 2.x should upgrade to version 2.5.9 or later, and users of 3.x should upgrade to 3.0.0-M3 or later. The fix enforces upper bounds on array allocation sizes to prevent heap exhaustion. Deployments that cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified and avoid loading models from untrusted or third-party sources without integrity checks. The vendor advisory does not indicate any temporary fixes or that no action is required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2026-04-27T12:43:14.347Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69f8d219cbff5d86103970b3
Added to database: 5/4/2026, 5:06:33 PM
Last enriched: 5/12/2026, 6:25:51 AM
Last updated: 6/18/2026, 4:41:20 AM
Views: 80
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.