CyberSecBulletin
CVE-2026-40682NVD status: Modified

Apache OpenNLP: Improper Restriction of XML External Entity Reference

CVE-2026-40682 is a high-severity improper restriction of XML external entity reference vulnerability in Apache OpenNLP from Apache, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 2.5.9, 3.0.0-M3, 1.9.5 as the first without the flaw, so updating Apache OpenNLP to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.5% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Apache OpenNLP to 2.5.9 or 3.0.0-M3 or 1.9.5, whichever matches your release line, or a later version.
  2. Update Opennlp to 2.5.9 or a later version.
  3. Read the advisory on lists.apache.org for workarounds and exact fixed builds.
  4. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
ApacheApache OpenNLP2.0 up to, but not including, 2.5.9; 3.0.0-M1 up to, but not including, 3.0.0-M3; before 1.9.52.5.9, 3.0.0-M3, 1.9.5
Red HatRed Hat build of Apache Camel for Spring Boot 4Not specified in the recordNot stated
Red HatRed Hat Data Grid 8Not specified in the recordNot stated
Red HatRed Hat Fuse 7Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform 8Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform Expansion PackNot specified in the recordNot stated
Red HatRed Hat OpenShift AI (RHOAI)Not specified in the recordNot stated
ApacheOpennlpbefore 2.5.9; 3.0.02.5.9

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
NoneNothing can be modified.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Scored by CNA.

Scoring systemScoreSeverityScored by
CVSS 3.19.1CriticalCISA (ADP)
CVSS 3.17.5HighCNA

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Restriction of XML External Entity Reference

The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.

How developers prevent this class of flaw

  • Many XML parsers and validators can be configured to disable external entity expansion.

More Improper Restriction of XML External Entity Reference vulnerabilities (CWE-611)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Other vulnerabilities in Apache OpenNLP

All Apache OpenNLP vulnerabilities

Recent Improper Restriction of XML External Entity Reference vulnerabilities

Spotted an error? Tell us.