Memory Allocation with Excessive Size Value Affecting org.apache.opennlp:opennlp-tools package, versions [,2.5.9)[3.0.0-M1,3.0.0-M3)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Social Trends
EPSS
0.6% (46th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGAPACHEOPENNLP-16535521
  • published8 May 2026
  • disclosed4 May 2026
  • creditSubramanian S

Introduced: 4 May 2026

CVE-2026-42440  (opens in a new tab)
CWE-789  (opens in a new tab)

How to fix?

Upgrade org.apache.opennlp:opennlp-tools to version 2.5.9, 3.0.0-M3 or higher.

Overview

org.apache.opennlp:opennlp-tools is an is a machine learning based toolkit for the processing of natural language text.

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the AbstractModelReader class. An attacker can cause the application to exhaust system memory and crash by supplying a crafted .bin model file with manipulated count fields that trigger unbounded array allocations during deserialization.

Note:

This is only exploitable if the application loads model files from untrusted or semi-trusted sources.

Workaround

This vulnerability can be mitigated by treating all .bin model files as untrusted input unless their provenance is verified, and by avoiding loading models supplied by end users or fetched from third-party repositories without integrity checks.

CVSS Base Scores

version 4.0
version 3.1