CVEfocus › CVE database › CVE-2026-40682

CVE-2026-40682Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor

CVSS 9.1 CriticalEPSS 0.5% (higher than 43% of CVEs)Published 2026-05-04Updated 2026-09-02Assigner: apache

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.

CWE-611

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

2Fixed
7Fix pending
1Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10apache-opennlpFix pendingUBUNTU-CVE-2026-40682
Ubuntu 26.04apache-opennlpFix pendingUBUNTU-CVE-2026-40682
Ubuntu 25.10apache-opennlpWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-40682
Ubuntu 24.04apache-opennlpFix pendingUBUNTU-CVE-2026-40682
Ubuntu 22.04apache-opennlpFix pendingUBUNTU-CVE-2026-40682
Ubuntu 20.04apache-opennlpFix pendingUBUNTU-CVE-2026-40682
Debian 14apache-opennlpFixed2.5.9-1DEBIAN-CVE-2026-40682
Debian 13apache-opennlpFix pendingDEBIAN-CVE-2026-40682
Debian 12apache-opennlpFix pendingDEBIAN-CVE-2026-40682
Maven libraryorg.apache.opennlp:opennlp-toolsFixed1.9.5GHSA-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.

Vendor advisories:

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.