Apache Software FoundationのApache OpenNLPにおける過剰なサイズ値のメモリ割り当てに関する脆弱性
タイトル Apache Software FoundationのApache OpenNLPにおける過剰なサイズ値のメモリ割り当てに関する脆弱性
概要

Apache OpenNLPのAbstractModelReaderに無制限の配列割り当てによるOOM(Out Of Memory)拒否サービス攻撃の脆弱性があります。この脆弱性は、AbstractModelReaderのgetOutcomes()、getOutcomePatterns()、およびgetPredicates()メソッドがモデルのバイナリストリームから読み取ったカウント値をそのまま配列のサイズとして使用し、値の検証を行っていないことによって発生します。そのため、攻撃者が細工したモデルファイルを読み込ませると、非常に大きな配列の割り当てを試み、Java仮想マシンのメモリを枯渇させてクラッシュさせることが可能です。影響を受けるバージョンは2.5.9未満および3.0.0-M3未満であり、対策としてそれら以降のバージョンへアップグレードすることが推奨されています。修正では、配列割り当て前に上限を設けて不正なサイズを検出し、読み込みを中断するようになっています。なお、アップグレードが困難な場合は、信頼できないモデルファイルの読み込みを避けるなどの安全対策を行ってください。

想定される影響 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う情報について、書き換えは発生しません。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
対策

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

公表日 2026年5月4日0:00
登録日 2026年5月8日12:22
最終更新日 2026年5月8日12:22
CVSS3.0 : 重要
スコア 7.5
ベクター CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
影響を受けるシステム
Apache Software Foundation
Apache OpenNLP 2.5.9 未満
Apache OpenNLP 3.0.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
変更履歴
No 変更内容 変更日
1 [2026年05月08日]
  掲載
2026年5月8日12:22

NVD脆弱性情報
CVE-2026-42440
概要

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 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.

公表日 2026年5月5日2:16
登録日 2026年5月5日4:07
最終更新日 2026年5月7日3:09
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:a:apache:opennlp:*:*:*:*:*:*:*:* 2.5.9
cpe:2.3:a:apache:opennlp:3.0.0:m1:*:*:*:*:*:*
cpe:2.3:a:apache:opennlp:3.0.0:m2:*:*:*:*:*:*
関連情報、対策とツール
共通脆弱性一覧