Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.4%top 68%

CVE-2026-40682: CWE-611 Improper Restriction of XML External Entity Reference in Apache Software Foundation Apache OpenNLP

0
Critical
VulnerabilityCVE-2026-40682cvecve-2026-40682cwe-611
Published: Mon May 04 2026 (05/04/2026, 16:55:55 UTC)
Source: CVE Database V5
Vendor/Project: Apache Software Foundation
Product: Apache OpenNLP

Description

CVE-2026-40682 is a critical XML External Entity (XXE) vulnerability in Apache OpenNLP affecting versions before 2.5.9 and before 3.0.0-M3. The issue arises because the DictionaryEntryPersistor class initializes an XML parser without disabling DTD processing or enabling secure processing features, allowing crafted dictionary files with malicious DOCTYPE declarations to trigger local file disclosure or server-side request forgery during XML parsing. This vulnerability impacts the public Dictionary(InputStream) constructor, which is used to load user-supplied dictionaries, making exploitation realistic if untrusted input is processed. The project’s other XML parsing paths correctly mitigate this risk, but this specific path does not. Users are advised to upgrade to fixed versions or apply input validation to reject XML containing DOCTYPE declarations if immediate upgrade is not possible.

CVSS v3.1

Score 9.1critical

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Affected software

Affected versions
=0=3.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/12/2026, 06:24:11 UTC

Technical Analysis

Apache OpenNLP versions prior to 2.5.9 and 3.0.0-M3 contain an XXE vulnerability in the DictionaryEntryPersistor class. The static SAXParserFactory is initialized without enabling FEATURE_SECURE_PROCESSING or disabling DTD processing, leaving external entity resolution and DOCTYPE declarations enabled. When the create(InputStream, EntryInserter) method is called, an attacker can supply a malicious dictionary XML file containing a crafted DOCTYPE declaration. This can lead to local file disclosure via file:// entity references or server-side request forgery via http:// entity references during SAX parsing. The vulnerability affects the public Dictionary(InputStream) constructor, which directly uses this parsing method and is intended for loading user dictionaries, thus exposing a realistic attack vector. The issue contrasts with other XML parsing code in the project that correctly disables these risky features. The recommended mitigation is upgrading to Apache OpenNLP 2.5.9 or 3.0.0-M3, or otherwise validating input to reject XML with DOCTYPE declarations.

Potential Impact

Successful exploitation allows an attacker to perform XML External Entity attacks leading to local file disclosure or server-side request forgery. This can result in unauthorized access to sensitive files on the server or interaction with internal network resources, potentially compromising confidentiality and integrity. The CVSS score of 9.1 reflects the critical nature of this vulnerability with network attack vector, low attack complexity, no privileges required, and no user interaction needed.

Mitigation Recommendations

Users should upgrade Apache OpenNLP to version 2.5.9 or later in the 2.x series, or 3.0.0-M3 or later in the 3.x series, where this vulnerability is fixed. If immediate upgrade is not feasible, users must ensure that all dictionary files are sourced from trusted origins. Additionally, input validation should be implemented to reject any XML input containing DOCTYPE declarations before it is processed by the vulnerable Dictionary(InputStream) constructor. There is no official patch link or advisory provided here, so users should consult the Apache OpenNLP project resources for the official fixed releases.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
apache
Date Reserved
2026-04-14T17:21:09.189Z
Cvss Version
null
State
PUBLISHED
Remediation Level
null

Threat ID: 69f8d216cbff5d8610397041

Added to database: 5/4/2026, 5:06:30 PM

Last enriched: 5/12/2026, 6:24:11 AM

Last updated: 6/19/2026, 1:26:45 AM

Views: 79

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses