Impact
The flaw arises because AbstractModelReader reads a signed integer from a binary model file and passes it directly to an array allocation without checking for negative or excessively large values. An attacker can craft a model file that sets the count fields to Integer.MAX_VALUE or another large value, causing an OutOfMemoryError during the early stages of deserialization. This represents a failure to enforce bounds on resource allocation (CWE-770) and unchecked resource consumption (CWE-789). The vulnerability leads to a denial‑of‑service condition when a vulnerable JVM attempts to load the malicious model.
Affected Systems
The vulnerability affects Apache OpenNLP prior to versions 2.5.9 and 3.0.0-M3. Any component that loads a .bin model file—such as GenericModelReader or higher‑level utilities— is impacted if it processes models from untrusted or semi‑trusted origins.
Risk and Exploitability
The risk is high in environments where user or third‑party supplied model files are accepted, because an attacker can trigger a crash with a single, lightweight file. The CVSS score is 7.5, indicating significant potential for automated exploitation. The EPSS score of <1% indicates a very low but non‑zero likelihood of exploitation, and the vulnerability is not listed in CISA’s KEV catalog, which does not alter the possibility of a denial‑of‑service attack. The attack vector is local or remote, depending on whether the application accepts model files over a network or from untrusted users.
OpenCVE Enrichment
Github GHSA