CVE-2026-40682 — Vulnerability in opennlp-tools — CVE Details
Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing
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.
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.
<!-- Update pom.xml dependency version to 3.0.0-M3 for org.apache.opennlp:opennlp-tools -->
<!-- Update pom.xml dependency version to 1.9.5 for org.apache.opennlp:opennlp-tools -->
<!-- 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).
| Package | Fixed In |
|---|---|
| org.apache.opennlp:opennlp-tools Maven · Affected: 3.0.0-M1, 3.0.0-M2 | 3.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-611XML External Entity (XXE)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-40682ADVISORY
- https://access.redhat.com/security/cve/CVE-2026-40682WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2466484WEB
- https://github.com/apache/opennlpPACKAGE
- https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6WEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40682.jsonWEB
- https://www.openwall.com/lists/oss-security/2026/05/01/19WEB
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
Maximum impact if exploited, often with little effort or access required.
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
Related CVEs
- CVE-2026-107726CRITICAL
Hazelcast allows arbitrary member memory access by low-privileged client
- CVE-2026-42027CRITICAL
Apache OpenNLP ExtensionLoader Vulnerable to Arbitrary Class Instantiation via Model Manifest
- CVE-2026-107282CRITICAL
AsyncHttpClient: Replay to a different host sends the original host request and credentials to the new host