Skip to main content

CVE-2026-40682 — Vulnerability in opennlp-tools — CVE Details

CRITICAL

Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing

Published May 4, 2026Updated October 2, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.84%). Schedule for your next planned update.

Does your project use an affected org.apache.opennlp:opennlp-tools version?

Paste your pom.xml to check it for CVE-2026-40682 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my pom.xml

Summary

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.

Advisory Timeline

  • First published May 4, 2026 (206 days ago).
  • Last revised October 2, 2026 — 151 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update org.apache.opennlp:opennlp-tools to 3.0.0-M3 or later
<!-- Update pom.xml dependency version to 3.0.0-M3 for org.apache.opennlp:opennlp-tools -->
Maven
Update org.apache.opennlp:opennlp-tools to 1.9.5 or later
<!-- Update pom.xml dependency version to 1.9.5 for org.apache.opennlp:opennlp-tools -->
Maven
Update org.apache.opennlp:opennlp-tools to 2.5.9 or later
<!-- Update pom.xml dependency version to 2.5.9 for org.apache.opennlp:opennlp-tools -->

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: Maven (1).

PackageFixed In
org.apache.opennlp:opennlp-tools Maven · Affected: 3.0.0-M1, 3.0.0-M23.0.0-M3
org.apache.opennlp:opennlp-tools Maven · Affected: 1.5.1-incubating, 1.5.2-incubating, 1.5.3, 1.6.0 (+13 more)1.9.5
org.apache.opennlp:opennlp-tools Maven · Affected: 2.0.0, 2.1.0, 2.1.1, 2.2.0 (+15 more)2.5.9

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-611
    XML External Entity (XXE)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Frequently Asked Questions

What is CVE-2026-40682?
Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
How do I check if my project is affected by CVE-2026-40682?
CVE-2026-40682 affects org.apache.opennlp:opennlp-tools. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40682 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.1

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.84%
EPSS percentile: 55.3

This is an above-median EPSS score — 55.3% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-4v8g-86x5-3vrc

Related CVEs

  • CVE-2026-107726
    CRITICAL

    Hazelcast allows arbitrary member memory access by low-privileged client

  • CVE-2026-42027
    CRITICAL

    Apache OpenNLP ExtensionLoader Vulnerable to Arbitrary Class Instantiation via Model Manifest

  • CVE-2026-107282
    CRITICAL

    AsyncHttpClient: Replay to a different host sends the original host request and credentials to the new host

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my pom.xml