Apache OpenNLP: Improper Restriction of XML External Entity Reference
CVE-2026-40682 is a high-severity improper restriction of XML external entity reference vulnerability in Apache OpenNLP from Apache, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 2.5.9, 3.0.0-M3, 1.9.5 as the first without the flaw, so updating Apache OpenNLP to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.5% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Apache OpenNLP to 2.5.9 or 3.0.0-M3 or 1.9.5, whichever matches your release line, or a later version.
- Update Opennlp to 2.5.9 or a later version.
- Read the advisory on lists.apache.org for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Apache | Apache OpenNLP | 2.0 up to, but not including, 2.5.9; 3.0.0-M1 up to, but not including, 3.0.0-M3; before 1.9.5 | 2.5.9, 3.0.0-M3, 1.9.5 |
| Red Hat | Red Hat build of Apache Camel for Spring Boot 4 | Not specified in the record | Not stated |
| Red Hat | Red Hat Data Grid 8 | Not specified in the record | Not stated |
| Red Hat | Red Hat Fuse 7 | Not specified in the record | Not stated |
| Red Hat | Red Hat JBoss Enterprise Application Platform 8 | Not specified in the record | Not stated |
| Red Hat | Red Hat JBoss Enterprise Application Platform Expansion Pack | Not specified in the record | Not stated |
| Red Hat | Red Hat OpenShift AI (RHOAI) | Not specified in the record | Not stated |
| Apache | Opennlp | before 2.5.9; 3.0.0 | 2.5.9 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Scored by CNA.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.1 | Critical | CISA (ADP) |
| CVSS 3.1 | 7.5 | High | CNA |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Restriction of XML External Entity Reference
The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
How developers prevent this class of flaw
- Many XML parsers and validators can be configured to disable external entity expansion.
More Improper Restriction of XML External Entity Reference vulnerabilities (CWE-611)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Third-party and government advisories
- openwall.com/lists/oss-security/2026/05/01/19Mailing List, Third Party Advisory
Other references
Other vulnerabilities in Apache OpenNLP
- 9.8 Critical severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Recent Improper Restriction of XML External Entity Reference vulnerabilities
- 9.1 Critical severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.6 High severity
- 7.5 High severity
Spotted an error? Tell us.