Skip to content
MediumVulnerability

CVE-2026-42440: Apache OpenNLP AbstractModelReader out-of-memory via unbounded array allocation

Identifier
CVE-2026-42440
Published
Record updated
View JSON
Affected
  • org.apache.opennlp:opennlp-tools < 2.5.9, fixed in 2.5.9
  • org.apache.opennlp:opennlp-tools >= 3.0.0-M1, < 3.0.0-M3, fixed in 3.0.0-M3
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.6%

Summary

CVE-2026-42440 is an out-of-memory denial-of-service flaw in Apache OpenNLP's AbstractModelReader, affecting versions before 2.5.9 and before 3.0.0-M3. The methods getOutcomes(), getOutcomePatterns() and getPredicates() allocate arrays using an unvalidated 32-bit count read from a binary model stream. A crafted .bin model file can set that count to Integer.MAX_VALUE, causing an OutOfMemoryError before the label or pattern data is read, so a single small file can crash any JVM that loads it.

Mitigation

2.x users should upgrade to 2.5.9. 3.x users should upgrade to 3.0.0-M3. Users who cannot upgrade immediately should treat all .bin model files as untrusted input unless their provenance is verified, and avoid loading models supplied by end users or fetched from third-party repositories without integrity checks.