CVE-2026-40682 Apache OpenNLP
| Affected software | Apache OpenNLP |
|---|---|
| Severity | 9.1 Critical CVSS 3.1 2 scores |
| Fixed in | 2.5.9, 3.0.0-M3, 1.9.5 |
| Weakness | XML external entity (XXE) (CWE-611) |
| Published | 4 May 2026 |
| Updated | 26 Oct 2026 |
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.
Exploitation status
No public exploit
No exploit has been reported in the sources we check.
Exploitation status
- CISA KEV not listed
- VulnCheck KEV not listed
- CISA Vulnrichment exploitation: none
- Indexed PoC none indexed
- EPSS 0.50% chance in 30 days
Waratek protection
Waratek has a rule that blocks attacks on this vulnerability.
- Protection full XXE
- Action available security rule
- Review automated Inferred
- Record active
| Decided by | A vulnerability class already blocked by an ARMR security rule |
|---|---|
| Finding | Protected by Waratek's ARMR xxe security rule, which blocks this class of attack at the JVM level without a rule written for this CVE specifically. The CVE's weakness is CWE-611: XML External Entity Reference. |
| Candidate fix | https://bugzilla.redhat.com/show_bug.cgi?id=2466484 : a Red Hat bug: the triage, which links onward to the fix |
How to mitigate CVE-2026-40682
Upgrade Apache OpenNLP to a release that fixes it: 2.5.9, 3.0.0-M3 or 1.9.5. Until you can, Waratek RASP blocks exploitation with its XXE rule. It runs inside the Java application, with no code changes.
CVSS
9.1 CRITICAL
v3.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
2 metrics
CVSS
9.1 CRITICAL v3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
2 metrics
We show the highest score from the newest CVSS version. Scores from different versions can't be compared, and the first score listed is sometimes a 0.0 placeholder.
| Version | Score | Band | Vector | Assigner | Type | |
|---|---|---|---|---|---|---|
| CVSS 3.1 | 9.1 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
CISA-ADP | Secondary | published |
| CVSS 3.1 | 7.5 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
redhat-SADP | Secondary |
Affected software and releases
Maven packages
Affected and fixed versions, from OSV.dev| Package | Introduced | Fixed | Last affected |
|---|---|---|---|
org.apache.opennlp:opennlp-tools |
2.0.0 | 2.5.9 |
unbounded |
org.apache.opennlp:opennlp-tools |
3.0.0-M1 | 3.0.0-M3 |
unbounded |
org.apache.opennlp:opennlp-tools |
0 | 1.9.5 |
unbounded |
Products and versions
2 products, 6 version entries| Source | Vendor | Product | Scheme | Affected versions |
|---|---|---|---|---|
| nvd | apache | opennlp | generic | < 2.5.9 · 3.0.0:m1 · 3.0.0:m2 |
| osv | org.apache.opennlp | opennlp-tools | generic | < 1.9.5 · ≥ 2.0.0 and < 2.5.9 · ≥ 3.0.0 and < 3.0.0 |
References
Timeline
Timeline
| Published | 2026-05-04 | By the CVE Program. |
|---|---|---|
| NVD record modified | 2026-10-26 | NVD's own last-modified date for this record. |