CVE-2026-40682
CVE-2026-40682 is a critical-severity vulnerability in Apache Opennlp with a CVSS 3.x base score of 9.1. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-611.
Key facts
- Severity: Critical (CVSS 3.x base score 9.1)
- EPSS exploit prediction: 1% (40th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2026-27003
- Weakness: CWE-611
- Affected product: Apache Opennlp
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2026-40682?
- 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.
- How severe is CVE-2026-40682?
- CVE-2026-40682 has a CVSS 3.x base score of 9.1, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability none.
- Is CVE-2026-40682 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (40th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2026-40682?
- CVE-2026-40682 primarily affects Apache Opennlp. In total, 3 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2026-40682?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its critical severity, prioritise patching exposed systems.
- Does CVE-2026-40682 have an EU (EUVD) identifier?
- Yes. CVE-2026-40682 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-27003.
- When was CVE-2026-40682 published?
- CVE-2026-40682 was published on 2026-05-04 and last updated on 2026-06-30.
References
- https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6
- http://www.openwall.com/lists/oss-security/2026/05/01/19
- https://access.redhat.com/security/cve/CVE-2026-40682
- https://bugzilla.redhat.com/show_bug.cgi?id=2466484
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40682.json
Affected products (3)
- cpe:2.3:a:apache:opennlp:*:*:*:*:*:*:*:*
- cpe:2.3:a:apache:opennlp:3.0.0:m1:*:*:*:*:*:*
- cpe:2.3:a:apache:opennlp:3.0.0:m2:*:*:*:*:*:*
More vulnerabilities in Apache Opennlp
- CVE-2026-42027 — Critical (CVSS 9.8): Arbitrary Class Instantiation via Model Manifest in Apache OpenNLP ExtensionLoader Versions Affected: before…
- CVE-2017-12620 — Critical (CVSS 9.8): When loading models or dictionaries that contain XML it is possible to perform an XXE attack, since Apache OpenNLP is a…
- CVE-2026-42440 — High (CVSS 7.5): OOM Denial of Service via Unbounded Array Allocation in Apache OpenNLP AbstractModelReader Versions…
All CVEs affecting Apache Opennlp →
Other CWE-611 (Improper Restriction of XML External Entity Reference (XXE)) vulnerabilities
- CVE-2022-22486 — Critical (CVSS 10.0): IBM Tivoli Workload Scheduler 9.4, 9.5, and 10.1 is vulnerable to an XML External Entity Injection (XXE) attack when…
- CVE-2019-14678 — Critical (CVSS 10.0): SAS XML Mapper 9.45 has an XML External Entity (XXE) vulnerability that can be leveraged by malicious attackers in…
- CVE-2015-9280 — Critical (CVSS 10.0): MailEnable before 8.60 allows XXE via an XML document in the request.aspx Options parameter.
- CVE-2018-1000838 — Critical (CVSS 10.0): autopsy version <= 4.9.0 contains a XML External Entity (XXE) vulnerability in CaseMetadata XML Parser that can result…
- CVE-2018-1000837 — Critical (CVSS 10.0): UML Designer version <= 8.0.0 contains a XML External Entity (XXE) vulnerability in XML parser for plugins that can…
- CVE-2018-1000835 — Critical (CVSS 10.0): KeePassDX version <= 2.5.0.0beta17 contains a XML External Entity (XXE) vulnerability in kdbx file parser that can…
Browse all CWE-611 (Improper Restriction of XML External Entity Reference (XXE)) vulnerabilities →