Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing
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 Dicti
GHSA-4v8g-86x5-3vrc
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-4v8g-86x5-3vrc
org.apache.opennlp:opennlp-tools
Source reference: /affected/0/package/name
- Affected versions
- 2.0.0
Source reference:
/affected/0/versions2.1.0Source reference:
/affected/0/versions2.1.1Source reference:
/affected/0/versions2.2.0Source reference:
/affected/0/versions2.3.0Source reference:
/affected/0/versions2.3.1Source reference:
/affected/0/versions2.3.2Source reference:
/affected/0/versions2.3.3Source reference:
/affected/0/versions2.4.0Source reference:
/affected/0/versions2.5.0Source reference:
/affected/0/versions2.5.1Source reference:
/affected/0/versions2.5.2Source reference:
/affected/0/versions2.5.3Source reference:
/affected/0/versions2.5.4Source reference:
/affected/0/versions2.5.5Source reference:
/affected/0/versions2.5.6Source reference:
/affected/0/versions2.5.6.1Source reference:
/affected/0/versions2.5.7Source reference:
/affected/0/versions2.5.8Source reference:
/affected/0/versions - Fixed versions
- 2.5.9
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
org.apache.opennlp:opennlp-tools
Source reference: /affected/1/package/name
- Affected versions
- 3.0.0-M1
Source reference:
/affected/1/versions3.0.0-M2Source reference:
/affected/1/versions - Fixed versions
- 3.0.0-M3
Source reference:
/affected/1/ranges - Prerequisites
- Not stated in this record
org.apache.opennlp:opennlp-tools
Source reference: /affected/2/package/name
- Affected versions
- 1.5.1-incubating
Source reference:
/affected/2/versions1.5.2-incubatingSource reference:
/affected/2/versions1.5.3Source reference:
/affected/2/versions1.6.0Source reference:
/affected/2/versions1.7.0Source reference:
/affected/2/versions1.7.1Source reference:
/affected/2/versions1.7.2Source reference:
/affected/2/versions1.8.0Source reference:
/affected/2/versions1.8.1Source reference:
/affected/2/versions1.8.2Source reference:
/affected/2/versions1.8.3Source reference:
/affected/2/versions1.8.4Source reference:
/affected/2/versions1.9.0Source reference:
/affected/2/versions1.9.1Source reference:
/affected/2/versions1.9.2Source reference:
/affected/2/versions1.9.3Source reference:
/affected/2/versions1.9.4Source reference:
/affected/2/versions - Fixed versions
- 1.9.5
Source reference:
/affected/2/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.5.9"
}
]
}
],
"package": {
"name": "org.apache.opennlp:opennlp-tools",
"purl": "pkg:maven/org.apache.opennlp/opennlp-tools",
"ecosystem": "Maven"
},
"versions": [
"2.0.0",
"2.1.0",
"2.1.1",
"2.2.0",
"2.3.0",
"2.3.1",
"2.3.2",
"2.3.3",
"2.4.0",
"2.5.0",
"2.5.1",
"2.5.2",
"2.5.3",
"2.5.4",
"2.5.5",
"2.5.6",
"2.5.6.1",
"2.5.7",
"2.5.8"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-4v8g-86x5-3vrc/GHSA-4v8g-86x5-3vrc.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "3.0.0-M1"
},
{
"fixed": "3.0.0-M3"
}
]
}
],
"package": {
"name": "org.apache.opennlp:opennlp-tools",
"purl": "pkg:maven/org.apache.opennlp/opennlp-tools",
"ecosystem": "Maven"
},
"versions": [
"3.0.0-M1",
"3.0.0-M2"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-4v8g-86x5-3vrc/GHSA-4v8g-86x5-3vrc.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.9.5"
}
]
}
],
"package": {
"name": "org.apache.opennlp:opennlp-tools",
"purl": "pkg:maven/org.apache.opennlp/opennlp-tools",
"ecosystem": "Maven"
},
"versions": [
"1.5.1-incubating",
"1.5.2-incubating",
"1.5.3",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.8.0",
"1.8.1",
"1.8.2",
"1.8.3",
"1.8.4",
"1.9.0",
"1.9.1",
"1.9.2",
"1.9.3",
"1.9.4"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-4v8g-86x5-3vrc/GHSA-4v8g-86x5-3vrc.json"
}
}
]- Related CVEs
- CVE-2026-40682
Source reference:
/aliases
Publisher severity
critical
Source reference: /database_specific/severity
- Event
- #71650 · Revision 1
- Added to Heist Feed
- Publisher date