cbcvebase.
CVE-2026-40682
published 2026-05-04

CVE-2026-40682: XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor Versions Affected: before 2.5.9, before 3.0.0-M3…

PriorityP261critical9.1CVSS 3.1
AVNACLPRNUINSUCHIHAN
EPSS
0.52%
40.4th percentile
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.

Affected

9 ranges
VendorProductVersion rangeFixed in
apacheopennlp< 2.5.92.5.9
apacheopennlp
apacheopennlp
apache_software_foundationapache_opennlp< 1.9.51.9.5
apache_software_foundationapache_opennlp>= 2.0 < 2.5.92.5.9
apache_software_foundationapache_opennlp>= 3.0.0-M1 < 3.0.0-M33.0.0-M3
rhoaiodh-trustyai-service-rhel8
rhoaiodh-trustyai-service-rhel9
rhoaiodh-workbench-jupyter-trustyai-cpu-py312-rhel9

Detection & IOCsextracted from sources · hover to see the quote

  • Detect XXE exploitation attempts via file:// entity references in XML dictionary files supplied to Apache OpenNLP DictionaryEntryPersistor
  • Detect XXE exploitation attempts via http:// entity references (SSRF) in XML dictionary files supplied to Apache OpenNLP DictionaryEntryPersistor
  • Flag any XML input stream containing a DOCTYPE declaration passed to the Dictionary(InputStream) constructor or DictionaryEntryPersistor.create(InputStream, EntryInserter) — the presence of DOCTYPE in dictionary XML is the attack vector
  • Monitor for outbound HTTP requests originating from the JVM process hosting Apache OpenNLP (opennlp-tools) during dictionary parsing operations, which may indicate SSRF via XXE
  • Identify vulnerable Apache OpenNLP deployments: opennlp-tools versions before 2.5.9 (2.x branch) or before 3.0.0-M3 (3.x branch) are affected; flag these in SCA/dependency scanning
  • ·The vulnerable code path is DictionaryEntryPersistor — it initializes a static SAXParserFactory at class-load time without FEATURE_SECURE_PROCESSING or DTD disabling; the only feature set on the XMLReader is namespace support, leaving external entity resolution and DOCTYPE declarations fully enabled
  • ·The vulnerability is inconsistent with the project's own safe helper: XmlUtil.createSaxParser() correctly sets FEATURE_SECURE_PROCESSING and disallow-doctype-decl and is used by all other XML parsing paths — only DictionaryEntryPersistor is affected
  • ·The public Dictionary(InputStream) constructor is the documented API for loading user-supplied dictionaries and delegates directly to the vulnerable DictionaryEntryPersistor.create() method, making untrusted input a realistic exploitation scenario
  • ·Multiple Red Hat products are under investigation for impact, including opennlp-tools in Red Hat Data Grid 8, Red Hat Fuse 7, Red Hat JBoss EAP Expansion Pack, and RHOAI container images (odh-trustyai-service-rhel8/rhel9, odh-workbench-jupyter-trustyai-cpu-py312-rhel9)

CVSS provenance

nvdv3.19.1CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
vendor_redhat9.1CRITICAL
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.