Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Partial Red Hat: 2 fixed, 1 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA, GitHub and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Apache | Apache OpenNLP | 2.0 to before 2.5.9; 3.0.0-M1 to before 3.0.0-M3; before 1.9.5 | 2.5.9, 3.0.0-M3, 1.9.5 | Patch available | CNA |
| — | org.apache.opennlp:opennlp-tools (Maven) | 2.0.0 to before 2.5.9 | 2.5.9 | Patch available | GHSA-4v8g-86x5-3vrc |
| — | org.apache.opennlp:opennlp-tools (Maven) | 3.0.0-M1 to before 3.0.0-M3 | 3.0.0-M3 | Patch available | GHSA-4v8g-86x5-3vrc |
| — | org.apache.opennlp:opennlp-tools (Maven) | before 1.9.5 | 1.9.5 | Patch available | GHSA-4v8g-86x5-3vrc |
- Apache OpenNLP VendorApache 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 Patch available CNA
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected 2.0.0 to before 2.5.9 Fixed in 2.5.9 Patch available GHSA-4v8g-86x5-3vrc
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected 3.0.0-M1 to before 3.0.0-M3 Fixed in 3.0.0-M3 Patch available GHSA-4v8g-86x5-3vrc
- org.apache.opennlp:opennlp-tools (Maven) Vendor— Affected before 1.9.5 Fixed in 1.9.5 Patch available GHSA-4v8g-86x5-3vrc
Remediation
- Fix · CNA Apache OpenNLP (Apache Software Foundation) Fixed in 2.5.9, 3.0.0-M3, 1.9.5
- Fix · GHSA-4v8g-86x5-3vrc org.apache.opennlp:opennlp-tools (Maven) Fixed in 2.5.9 Advisory →
- Fix · GHSA-4v8g-86x5-3vrc org.apache.opennlp:opennlp-tools (Maven) Fixed in 3.0.0-M3 Advisory →
- Fix · GHSA-4v8g-86x5-3vrc org.apache.opennlp:opennlp-tools (Maven) Fixed in 1.9.5 Advisory →
Red Hat 2 advisories
- RHSA-2026:87410 Released 2026-10-21 · Red Hat rating CriticalRHOAI 2.25.12 - Red Hat OpenShift AI
- Red Hat OpenShift AI 2.25 registry.redhat.io/rhoai/odh-built-in-detector-rhel9, registry.redhat.io/rhoai/odh-caikit-nlp-rhel9, registry.redhat.io/rhoai/odh-codeflare-operator-rhel9 +47
- RHSA-2026:84734 Released 2026-10-19 · Red Hat rating CriticalRHOAI 3.4.5 - Red Hat OpenShift AI
- Red Hat OpenShift AI 3.4 registry.redhat.io/rhoai/odh-ai-gateway-payload-processing-rhel9, registry.redhat.io/rhoai/odh-automl-rhel9, registry.redhat.io/rhoai/odh-autorag-rhel9 +47
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
Apache OpenNLP 1.9.5, 2.5.9, 3.0.0-M3
3 records Highest priority Priority MEDIUM 3 MEDIUM
Other records, highest priority first
- TI-2026-30407 Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoaderPriority MEDIUM 50
- TI-2026-30730 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReaderPriority MEDIUM 40
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat OpenShift AI (RHOAI) | Affected | No fix planned: Will not fix |
| Red Hat OpenShift AI 2.25 | Fixed | RHSA-2026:87410 |
| Red Hat OpenShift AI 3.4 | Fixed | RHSA-2026:84734 |
Not affected: 7 products
- Red Hat Data Grid 8
- Red Hat Fuse 7
- Red Hat JBoss Enterprise Application Platform 8
- Red Hat JBoss Enterprise Application Platform Expansion Pack
- Red Hat OpenShift AI 2.25
- Red Hat OpenShift AI 3.4
- Red Hat build of Apache Camel for Spring Boot 4
Timeline
- 2026-10-02 Threatist record created from CVE-2026-40682
- 2026-10-03 Alias added: GHSA-4v8g-86x5-3vrc
- 2026-10-20 Fix available: RHSA-2026:84734 · Red Hat
- 2026-10-20 Fix available: Red Hat OpenShift AI 3.4 · Red Hat
- 2026-10-22 Fix available: RHSA-2026:87410 · Red Hat
- 2026-10-23 Fix available: Red Hat OpenShift AI 2.25 · Red Hat
- 2026-10-25 EPSS moved to the below the 50th percentile
References
Advisory 3
More Apache Opennlp vulnerabilities
- TI-2026-31914 Apache OpenNLP :: Core :: ML :: LibSVM: Unsafe Java Deserialization in SvmDoccatModel CVSS 3.1HIGH 7.3
- TI-2026-56958 Apache OpenNLP, Apache OpenNLP: ReDoS / stack exhaustion in RegexNameFinderFactory built-in EMAIL and URL patterns CVSS 4.0CRITICAL 10.0
- TI-2026-30407 Apache OpenNLP: Arbitrary Class Instantiation via Model Manifest in ExtensionLoader CVSS 3.1CRITICAL 9.8
- TI-2017-09345 XML external entity injection in Apache OpenNLP CVSS 3.0CRITICAL 9.8
- TI-2026-47528 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in SymSpellModelSerializer CVSS 3.1HIGH 7.5
- TI-2026-30730 Apache OpenNLP: OOM DoS via Unbounded Array Allocation in AbstractModelReader CVSS 3.1HIGH 7.5
Sources
- CVE-2026-40682 · CVE Program
- CVE-2026-40682 · NVD
- FIRST EPSS
- GHSA-4v8g-86x5-3vrc · GitHub Advisory Database · CC BY 4.0
- CVE-2026-40682 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences