apache-opennlp — security advisory
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
- Products
- apache-opennlp
- Affected versions
- 2.1.0-1, 2.2.0-1, 2.2.0-1~exp, 2.3.0-1, 2.3.1-1, 2.3.1-2, 2.3.2-1, 2.3.3-1, 2.4.0-1, 2.5.0-1, 2.5.1-1, 2.5.12-1, 2.5.2-1, 2.5.3-1, 2.5.9-1
- Fixed versions
- 2.5.9-1
- CVEs
- CVE-2026-40682
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 17:51 UTC · Revision 2
Source evidence
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
osv:DEBIAN-CVE-2026-40682
apache-opennlp
Fixed versions: Not specified
apache-opennlp
Fixed versions: Not specified
apache-opennlp
Fixed versions: 2.5.9-1
Complete source record
{
"id": "d5323981509bb7a5e59aa0cd2db93c9e897242222e870775916cb74e17aaf376",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-40682",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2026-40682",
"summary": "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",
"evidence": "osv:DEBIAN-CVE-2026-40682",
"products": [
{
"name": {
"value": "apache-opennlp",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.1.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.2.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.2.0-1~exp",
"evidence": "/affected/0/versions"
},
{
"value": "2.3.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.3.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.3.1-2",
"evidence": "/affected/0/versions"
},
{
"value": "2.3.2-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.3.3-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.4.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.12-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.2-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.3-1",
"evidence": "/affected/0/versions"
},
{
"value": "2.5.9-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "apache-opennlp",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.5.12-1",
"evidence": "/affected/1/versions"
},
{
"value": "2.5.3-1",
"evidence": "/affected/1/versions"
},
{
"value": "2.5.9-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "apache-opennlp",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.5.9-1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": [
{
"value": "2.5.3-1",
"evidence": "/affected/2/versions"
}
]
}
],
"severity": "critical",
"structured": {
"id": "DEBIAN-CVE-2026-40682",
"aliases": [
"DEBIAN-CVE-2026-40682"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "apache-opennlp",
"purl": "pkg:deb/debian/apache-opennlp?arch=source&distro=bookworm",
"ecosystem": "Debian:12"
},
"versions": [
"2.1.0-1",
"2.2.0-1",
"2.2.0-1~exp",
"2.3.0-1",
"2.3.1-1",
"2.3.1-2",
"2.3.2-1",
"2.3.3-1",
"2.4.0-1",
"2.5.0-1",
"2.5.1-1",
"2.5.12-1",
"2.5.2-1",
"2.5.3-1",
"2.5.9-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-40682.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "apache-opennlp",
"purl": "pkg:deb/debian/apache-opennlp?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"versions": [
"2.5.12-1",
"2.5.3-1",
"2.5.9-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-40682.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.5.9-1"
}
]
}
],
"package": {
"name": "apache-opennlp",
"purl": "pkg:deb/debian/apache-opennlp?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"versions": [
"2.5.3-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-40682.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-27T09:47:43.445216346Z",
"provider": "osv",
"upstream": [
"CVE-2026-40682"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2026-40682"
]
},
"related_cves": [
{
"value": "CVE-2026-40682",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 461385,
"published_at": "2026-05-04T17:16:23.657+00:00"
}