WaratekVRT Sign in

CVE-2026-40682 Apache OpenNLP

Affected softwareApache OpenNLP
Severity9.1 Critical CVSS 3.1 2 scores
Fixed in2.5.9, 3.0.0-M3, 1.9.5
WeaknessXML external entity (XXE) (CWE-611)
Published4 May 2026
Updated26 Oct 2026

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.

Exploitation status

No public exploit

No exploit has been reported in the sources we check.

  • CISA KEV not listed
  • VulnCheck KEV not listed
  • CISA Vulnrichment exploitation: none
  • Indexed PoC none indexed
  • EPSS 0.50% chance in 30 days

Waratek protection

Protected by Waratek

Waratek has a rule that blocks attacks on this vulnerability.

  • Protection full XXE
  • Action available security rule
  • Review automated Inferred
  • Record active
Decided by A vulnerability class already blocked by an ARMR security rule
Finding Protected by Waratek's ARMR xxe security rule, which blocks this class of attack at the JVM level without a rule written for this CVE specifically. The CVE's weakness is CWE-611: XML External Entity Reference.
Candidate fix https://bugzilla.redhat.com/show_bug.cgi?id=2466484 : a Red Hat bug: the triage, which links onward to the fix

How to mitigate CVE-2026-40682

Upgrade Apache OpenNLP to a release that fixes it: 2.5.9, 3.0.0-M3 or 1.9.5. Until you can, Waratek RASP blocks exploitation with its XXE rule. It runs inside the Java application, with no code changes.

Waratek RASP Runtime protection for Java applications

CVSS

9.1 CRITICAL v3.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N 2 metrics

We show the highest score from the newest CVSS version. Scores from different versions can't be compared, and the first score listed is sometimes a 0.0 placeholder.

VersionScoreBandVectorAssignerType
CVSS 3.1 9.1 CRITICAL CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N CISA-ADP Secondary published
CVSS 3.1 7.5 HIGH CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N redhat-SADP Secondary

Affected software and releases

Maven packages

Affected and fixed versions, from OSV.dev
PackageIntroducedFixedLast affected
org.apache.opennlp:opennlp-tools 2.0.0 2.5.9 unbounded
org.apache.opennlp:opennlp-tools 3.0.0-M1 3.0.0-M3 unbounded
org.apache.opennlp:opennlp-tools 0 1.9.5 unbounded

Products and versions

2 products, 6 version entries
SourceVendorProductSchemeAffected versions
nvd apache opennlp generic < 2.5.9 · 3.0.0:m1 · 3.0.0:m2
osv org.apache.opennlp opennlp-tools generic < 1.9.5 · ≥ 2.0.0 and < 2.5.9 · ≥ 3.0.0 and < 3.0.0

References

URLTags
https://bugzilla.redhat.com/show_bug.cgi?id=2466484 bugzilla
https://access.redhat.com/security/cve/CVE-2026-40682 WEB
https://github.com/apache/opennlp PACKAGE
https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6 WEB
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40682.json WEB
http://www.openwall.com/lists/oss-security/2026/05/01/19 WEB

Timeline

Published2026-05-04By the CVE Program.
NVD record modified2026-10-26NVD's own last-modified date for this record.