CVE-2026-40682Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor
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.
What to do
Fixed builds are available from Debian, Maven: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | apache-opennlp | Fix pending | UBUNTU-CVE-2026-40682 | |
| Ubuntu 26.04 | apache-opennlp | Fix pending | UBUNTU-CVE-2026-40682 | |
| Ubuntu 25.10 | apache-opennlp | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2026-40682 | |
| Ubuntu 24.04 | apache-opennlp | Fix pending | UBUNTU-CVE-2026-40682 | |
| Ubuntu 22.04 | apache-opennlp | Fix pending | UBUNTU-CVE-2026-40682 | |
| Ubuntu 20.04 | apache-opennlp | Fix pending | UBUNTU-CVE-2026-40682 | |
| Debian 14 | apache-opennlp | Fixed | 2.5.9-1 | DEBIAN-CVE-2026-40682 |
| Debian 13 | apache-opennlp | Fix pending | DEBIAN-CVE-2026-40682 | |
| Debian 12 | apache-opennlp | Fix pending | DEBIAN-CVE-2026-40682 | |
| Maven library | org.apache.opennlp:opennlp-tools | Fixed | 1.9.5 | GHSA-4v8g-86x5-3vrc |
What the vendor says
As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Apache Software Foundation Apache OpenNLP: affected: 2.0 to before 2.5.9, 3.0.0-M1 to before 3.0.0-M3, before 1.9.5; fixed in
2.5.9,3.0.0-M3,1.9.5
Vendor advisories:
- https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6 (vendor-advisory)
References
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.