CVE-2026-40682: Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor
This Apache advisory covers CVE-2026-40682 in Apache OpenNLP DictionaryEntryPersistor.
Am I affected by CVE-2026-40682?
You are affected if you run Apache OpenNLP DictionaryEntryPersistor at one of the versions below. If you do, upgrade to the fixed release listed for your version.
| Affected | Fixed in |
|---|---|
| Apache OpenNLP 2.0 before 2.5.9 | 2.5.9 |
| Apache OpenNLP 3.0.0-M1 before 3.0.0-M3 | 3.0.0-M3 |
| Apache OpenNLP before 1.9.5 | 1.9.5 |
Official advisory · high-confidence parse· fetched ·verify at source
Key facts
- Vendor rating
- Critical, CVSS 9.1
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N· base score 9.1, scored by CISA-ADPAttack vector: network. Attack complexity: low. Privileges required: none. User interaction: none. Scope: unchanged. Confidentiality impact: high. Integrity impact: high. Availability impact: none.- Weakness
- CWE-611 Improper Restriction of XML External Entity Reference
- EPSS
- 0.51% chance of exploitation in the next 30 days (45th percentile). FIRST EPSS, .
- CISA SSVC
- Exploitation: none observed. Automatable: yes. Technical impact: total. CISA, .
- CISA KEV
- Not listed (catalogue checked )
- Source published
- Source revised
- Listed by VulniPulse
- Record changed
Compiled by VulniPulse from the linked sources. How records are collected and checked.
Affected products & platforms
Description
XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor
Versions Affected: before 2.5.9, before 3.0.0-M3
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.
Text from the source record.
How to fix CVE-2026-40682
Upgrade to the first fixed release for your version, shown in the table above.
Vendor guidance
- 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.
CVE-2026-40682 in other vendors' advisories
- Red Hat: CVE-2026-40682, high severity
CVE-2026-40682 questions
Is CVE-2026-40682 being exploited?
CISA does not list it in its Known Exploited Vulnerabilities catalog (checked ), and the Apache advisory does not report exploitation. That is not proof it is unexploited.
Am I affected by CVE-2026-40682?
You are affected if you run Apache OpenNLP DictionaryEntryPersistor at one of the versions below. If you do, upgrade to the fixed release listed for your version. The table above lists each version.
How do I fix CVE-2026-40682?
Upgrade to a fixed release Apache lists for your version: 2.5.9, 3.0.0-M3, 1.9.5. The advisory's own guidance is above.
How likely is CVE-2026-40682 to be exploited?
FIRST's EPSS model gives it a 0.51% chance of exploitation in the next 30 days (45th percentile among scored CVEs, model date ). It is a forecast, not a report of attacks.
How serious is CVE-2026-40682?
Apache rates it critical, CVSS 9.1 out of 10.
More Apache Software Foundation advisories
CVE-2026-137442Dec 3, 2026Apache OFBiz: Direct Request in Order Confirmation EmailCVE-2026-136829Dec 3, 2026Apache OFBiz: Use of Non-Canonical URL Paths in Password-Reset SessionsCVE-2026-136828Dec 3, 2026Apache OFBiz: Authorization Bypass Through User-Controlled Key in Work Effort AssociationsCVE-2026-136827Dec 3, 2026Apache OFBiz: Direct Request in Manufacturing Production Run ServicesCVE-2026-136826Dec 3, 2026Apache OFBiz: Direct Request in Order Requirement ServicesCVE-2026-136820Dec 3, 2026Apache OFBiz: Direct Request in Customer Request Services
Apache Software Foundation advisories, May 2026All Apache Software Foundation advisories
Get an email when Apache publishes the next one.
See Apache's last 90 days first. Live alerts for one product are free for life; every vendor is US$10 a month with Pro (first month US$5).