{"answers":{"affected":"4 open source packages ship an affected version, including org.apache.opennlp:opennlp-tools. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-42440 in the wild and no public exploit code.","fix":"Upgrade org.apache.opennlp:opennlp-tools to a fixed version for your release line: 2.5.9 or 3.0.0-M3.","what":"CVE-2026-42440 is a high-severity denial of service vulnerability in Apache OpenNLP, published on 4 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-42440 and fix it if it is affected.\n\nWhat it is: CVE-2026-42440 is a high-severity denial of service vulnerability in Apache OpenNLP, published on 4 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-42440 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.apache.opennlp:opennlp-tools (Maven): affected all versions; fixed in 2.5.9\n- org.apache.opennlp:opennlp-tools (Maven): affected all versions; fixed in 2.5.9\n- org.apache.opennlp:opennlp-tools (Maven): affected from 3.0.0-M1; fixed in 3.0.0-M3\n- org.apache.opennlp:opennlp-tools (Maven): affected from 3.0.0-M1; fixed in 3.0.0-M3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-42440/ (Markdown: https://insights.sbomify.com/CVE-2026-42440/index.md)","id":"CVE-2026-42440","markdown":"https://insights.sbomify.com/CVE-2026-42440/index.md","name":"CVE-2026-42440","record":{"aliases":["DEBIAN-CVE-2026-42440","GHSA-659w-93r5-9j6m","UBUNTU-CVE-2026-42440"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Java NLP library","requires_auth":"none","summary":"Attacker can cause denial of service via crafted model file triggering out-of-memory error in Apache OpenNLP library.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"apache","cpe":[{"product":"opennlp","vendor":"apache"}],"cvss":{"score":7.5,"severity":"high","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-770","name":"Allocation of Resources Without Limits or Throttling"},{"id":"CWE-789","name":"Memory Allocation with Excessive Size Value"}],"description":"OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader \n\nVersions Affected: \n\nbefore 1.9.5\nbefore 2.5.9\n\nbefore 3.0.0-M3 \n\nDescription:\n\nThe 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.\n\nA 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.\n\nThe practical impact is denial of service against processes that load model files from untrusted or semi-trusted origins.  \n\nMitigation:\n\n  *  2.x users should upgrade to 2.5.9.\n\n  *  3.x users should upgrade to 3.0.0-M3.\n\nNote: 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.\n\nUsers 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.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader","id":"CVE-2026-42440","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":4,"n_references":1,"next":{"headline":"NanaZip: Null-pointer dereference in NanaZip UFS parser when root inode is a symlink","id":"CVE-2026-42442"},"packages":[{"ecosystem":"Maven","fixed":["2.5.9"],"introduced":["0"],"last_affected":[],"package":"org.apache.opennlp:opennlp-tools","purl":null,"source":"GHSA-659w-93r5-9j6m"},{"ecosystem":"Maven","fixed":["2.5.9"],"introduced":["0"],"last_affected":[],"package":"org.apache.opennlp:opennlp-tools","purl":"pkg:maven/org.apache.opennlp/opennlp-tools","source":"GHSA-659w-93r5-9j6m"},{"ecosystem":"Maven","fixed":["3.0.0-M3"],"introduced":["3.0.0-M1"],"last_affected":[],"package":"org.apache.opennlp:opennlp-tools","purl":null,"source":"GHSA-659w-93r5-9j6m"},{"ecosystem":"Maven","fixed":["3.0.0-M3"],"introduced":["3.0.0-M1"],"last_affected":[],"package":"org.apache.opennlp:opennlp-tools","purl":"pkg:maven/org.apache.opennlp/opennlp-tools","source":"GHSA-659w-93r5-9j6m"}],"prev":{"headline":"OpenClaw \u003c 2026.4.10 - SSRF Policy Bypass in Browser Tabs Action Routes","id":"CVE-2026-42439"},"products":["Apache OpenNLP"],"published":"2026-05-04","related":[{"cvss_score":10,"headline":"Apache OpenNLP, Apache OpenNLP: ReDoS / stack exhaustion in RegexNameFinderFactory built-in EMAIL and URL patterns","id":"CVE-2026-82617","kev_date_added":null,"published":"2026-09-11"},{"cvss_score":9.8,"headline":"Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader","id":"CVE-2026-42027","kev_date_added":null,"published":"2026-05-04"},{"cvss_score":9.8,"headline":"Improper Restriction of XML External Entity Reference in Apache OpenNLP","id":"CVE-2017-12620","kev_date_added":null,"published":"2017-10-02"},{"cvss_score":9.1,"headline":"Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor","id":"CVE-2026-40682","kev_date_added":null,"published":"2026-05-04"},{"cvss_score":7.5,"headline":"Apache OpenNLP: OOM DoS via Unbounded Array Allocation in SymSpellModelSerializer","id":"CVE-2026-67211","kev_date_added":null,"published":"2026-09-11"},{"cvss_score":7.3,"headline":"Apache OpenNLP :: Core :: ML :: LibSVM: Unsafe Java Deserialization in SvmDoccatModel","id":"CVE-2026-43825","kev_date_added":null,"published":"2026-07-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-07-30","vendors":["Apache Software Foundation"]},"summary":"Attacker can cause denial of service via crafted model file triggering out-of-memory error in Apache OpenNLP library.","url":"https://insights.sbomify.com/CVE-2026-42440/"}