CVE-2026-40682 Details
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.
A XML External Entity (XXE) vulnerability has been identified in the DictionaryEntryPersistor class of Apache OpenNLP. This issue affects versions prior to 2.5.9 and 3.0 through 3.0.0-M3. The vulnerability arises because the class initializes a static SAXParserFactory at load time without enabling secure processing or disabling DTD processing. As a result, when the 'create' method is called, external entity resolution and DOCTYPE declarations remain fully enabled. An attacker can exploit this by supplying a crafted dictionary file containing a malicious DOCTYPE declaration, potentially leading to local file disclosure or server-side request forgery during SAX parsing, before any dictionary entries are processed.
Users of Apache OpenNLP 2.x should upgrade to version 2.5.9, while 3.x users should upgrade to 3.0.0-M3. Those unable to upgrade immediately should ensure that all dictionary files are sourced from trusted origins and consider validating input to reject any XML containing a DOCTYPE declaration before it is parsed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 5, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://access.redhat.com/security/cve/CVE-2026-40682 | redhat-SADP | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2466484 | redhat-SADP | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40682.json | redhat-SADP | |
| http://www.openwall.com/lists/oss-security/2026/05/01/19 | CVE | Mailing ListThird Party Advisory |
| https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6 | [email protected] | Mailing ListVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-611 | Improper Restriction of XML External Entity Reference | redhat-SADP |
| CWE-611 | Improper Restriction of XML External Entity Reference | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| apache opennlp | < 2.5.9 3.0.0 m1 3.0.0 m2 |
CPE
Remediation
| |
Change History
13 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 2, 2026 | CVE Modified | redhat-SADP |
| Sep 2, 2026 | CVE Modified | CVE |
| Sep 2, 2026 | CVE Modified | [email protected] |
| Jul 15, 2026 | CVE Modified | redhat-SADP |
| Jun 30, 2026 | CVE Modified | [email protected] |
| Jun 30, 2026 | CVE Modified | redhat-SADP |
| Jun 29, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| May 6, 2026 | Initial Analysis | [email protected] |
| May 5, 2026 | CVE Modified | CISA-ADP |
| May 4, 2026 | CVE Modified | CVE |
| May 4, 2026 | New CVE Received | [email protected] |