CVE-2026-40682
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.
Description as published by the source, in English.
Key facts
- Published
- 2026-05-04
- Last modified
- 2026-10-26
- Assigned by
- security@apache.org
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N- Scored by
- 134c704f-9b21-4f2e-91b3-4a467353bcc0
- Probability of exploitation
-
0.5 %
higher than 40 %
of all known vulnerabilities
EPSS, next 30 days, model v2026.06.15 - Fix available
- Not registered in the sources
Affected products
| Vendor | Product | Versions | Status |
|---|---|---|---|
| Apache | Opennlp | < 2.5.9 | Affected |
| Apache | Opennlp | 3.0.0 | Affected |
Weakness type
-
CWE-611: 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.
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
Related at Berigo
Articles
-
Attackers are exploiting the plug-in in front of Oracle WebLogic
Same product
2026-08-25
CISA added CVE-2026-21962 to its Known Exploited Vulnerabilities Catalog on 24 August, citing evidence of active exploitation. The flaw sits in Oracl…
-
The crypto library behind Python now ships quantum-resistant algorithms
Same product
2026-08-18
Trail of Bits has added ML-KEM and ML-DSA to pyca/cryptography, funded by the Sovereign Tech Agency. The library is the eleventh most downloaded pack…
-
Unit 42: Chinese speaking actor ran autonomous attacks with an AI agent
Same product
2026-07-31
On 30 July 2026 Unit 42 published a campaign in which a Chinese speaking actor let an AI agent find targets, fetch exploit code and attempt exploitat…
-
AI agent chose targets and switched vulnerability on its own in Chinese campaign
Same product
2026-07-31
Unit 42 describes a Chinese speaking actor who paired the DeepSeek language model with the Hermes Agent framework, and let the setup find targets, pu…
Does this affect you?
A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.