Loading...
Skip to main content

CVE-2026-40682 — Vulnerability in org.apache.opennlp:opennlp-tools...

CRITICAL

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

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

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 (161 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, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: maven (1).

PackageEcosystemAffectedFixed In
org.apache.opennlp:opennlp-tools
maven
3.0.0-M1, 3.0.0-M23.0.0-M3
org.apache.opennlp:opennlp-tools
maven
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
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. 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

Exploitation is straightforward and causes maximum impact. Patch immediately.

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 if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies