Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-40682

CRITICAL 9.1EPSS 55%

Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor

Also known as GHSA-4v8g-86x5-3vrc

Mitigation

  • Upgrade org.apache.opennlp:opennlp-tools to one of 2.5.9, 3.0.0-M3, 1.9.5 (or later in the same release line).

Who should check

  • Projects that depend on Maven package org.apache.opennlp:opennlp-tools (>= 2.0.0, < 2.5.9)
  • Anyone running Apache Software Foundation Apache OpenNLP >= 2.0, < 2.5.9; >= 3.0.0-M1, < 3.0.0-M3; < 1.9.5

Vulnerability facts

Affected
org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9
Fixed in
2.5.9, 3.0.0-M3, 1.9.5
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: None
EPSS
0.84% chance of exploitation in 30 days (percentile 55, 2026-11-26)
CWE
CWE-611
Published
Modified

Description

XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor Versions Affected: before 2.5.9, before 3.0.0-M3 Description: The DictionaryEntryPersistor class initializes a static SAXParserFactory at class-load time without enabling FEATURE_SECURE_PROCESSING or disabling DTD processing. When create(InputStream, EntryInserter) is invoked, the only feature set on the XMLReader is namespace support — external entity resolution and DOCTYPE declarations remain fully enabled. An attacker who can supply a crafted dictionary file (e.g., a stop-word list or domain dictionary) containing a malicious DOCTYPE declaration can trigger local file disclosure via file:// entity references or server-side request forgery via http:// entity references during SAX parsing, before the application processes a single dictionary entry. This is inconsistent with the project's own XmlUtil.createSaxParser() helper, which correctly sets FEATURE_SECURE_PROCESSING and disallow-doctype-decl and is used by all other XML parsing paths in the codebase. The public Dictionary(InputStream) constructor delegates directly to this method and is the documented API for loading user-supplied dictionaries, making untrusted input a realistic scenario. 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 ensure that all dictionary files are sourced from trusted origins and should consider wrapping the Dictionary(InputStream) constructor with input validation that rejects any XML containing a DOCTYPE declaration before it reaches the parser.

Affected and fixed versions

Package / productAffectedFixedSource
Maven org.apache.opennlp:opennlp-tools>= 2.0.0, < 2.5.92.5.9, 3.0.0-M3, 1.9.5osv
Apache Software Foundation Apache OpenNLP>= 2.0, < 2.5.9; >= 3.0.0-M1, < 3.0.0-M3; < 1.9.5—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-40682. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-40682.md
Affected: org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9
Fixed in: 2.5.9, 3.0.0-M3, 1.9.5

Steps:
1. Search this machine and project for org.apache.opennlp:opennlp-tools (Maven), Apache Software Foundation Apache OpenNLP: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-40682 being exploited?

There is no confirmed exploitation: CVE-2026-40682 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.84% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-40682?

Critical: CVSS 9.1 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2026-40682?

org.apache.opennlp:opennlp-tools >= 2.0.0, < 2.5.9.

Is there a fix for CVE-2026-40682?

Yes. Fixed in 2.5.9, 3.0.0-M3, 1.9.5. Upgrade org.apache.opennlp:opennlp-tools to one of 2.5.9, 3.0.0-M3, 1.9.5 (or later in the same release line).

How do I check if I'm affected by CVE-2026-40682?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors