CVE-2026-40682: CWE-611 Improper Restriction of XML External Entity Reference in Apache Software Foundation Apache OpenNLP
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.
AI Analysis
Technical Summary
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.
CVE-2026-40682: CWE-611 Improper Restriction of XML External Entity Reference in Apache Software Foundation 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
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.