Security Digest · Vulnerability record

CVE-2026-40682: Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing

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 FEATURESECUREPROCESSING or disabling DTD…

CVSS 7.5 High EPSS 0.8% · p57

Should you act?

Normal patch cycle

No exploitation signal; fix it in your next routine update if you are affected. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 0.8%, percentile 57: FIRST’s model estimates a 0.8% chance of exploitation activity in the next 30 days, higher than 57% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes org.apache.opennlp:opennlp-tools (Maven) >= 3.0.0-M1, < 3.0.0-M3, fixed in 3.0.0-M3; org.apache.opennlp:opennlp-tools (Maven) >= 2.0.0, < 2.5.9, fixed in 2.5.9; org.apache.opennlp:opennlp-tools (Maven) < 1.9.5, fixed in 1.9.5. Check your lockfile, including transitive dependencies.

What it is

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

From the GitHub advisory

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

Weakness type: CWE-611.

Product: org.apache.opennlp:opennlp-tools (Maven) · Assigned by: apache · Published: 2026-05-04

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
Mavenorg.apache.opennlp:opennlp-tools>= 3.0.0-M1, < 3.0.0-M33.0.0-M3
Mavenorg.apache.opennlp:opennlp-tools>= 2.0.0, < 2.5.92.5.9
Mavenorg.apache.opennlp:opennlp-tools< 1.9.51.9.5
VendorProductAffected versions (per CVE record)
Apache Software FoundationApache OpenNLP2.0 < 2.5.9, 3.0.0-M1 < 3.0.0-M3, < 1.9.5

Severity scores

Scored byCVSSScoreVector
CISA-ADP3.19.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
redhat-SADP3.17.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub3.19.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: unchanged

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable yes, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.84% probability of exploitation activity in the next 30 days; percentile 57.

Timeline

  • — CVE record published by apache
  • — GitHub-reviewed advisory GHSA-4v8g-86x5-3vrc published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vendor and project advisories, patches

  1. lists.apache.org lists.apache.org

Vulnerability records

  1. GitHub Advisory GHSA-4v8g-86x5-3vrc github.com
  2. CVE.org record CVE-2026-40682 cve.org
  3. NVD entry CVE-2026-40682 nvd.nist.gov

Other references from the CVE record and advisory

  1. openwall.com openwall.com
  2. access.redhat.com access.redhat.com
  3. RHBZ#2466484 bugzilla.redhat.com
  4. security.access.redhat.com security.access.redhat.com

Critical Maven advisories · Today’s Security Digest