org.apache.opennlp:opennlp-tools: Apache OpenNLP DictionaryEntryPersistor Vulnerable to XML External Entity (XXE) via Unsanitized Dictionary Parsing
What fixes it
- 3.0.0-M3org.apache.opennlp:opennlp-tools, mavenGitHub
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>3.0.0-M3</version></dependency> - 2.5.9org.apache.opennlp:opennlp-tools, mavenGitHub
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>2.5.9</version></dependency> - 1.9.5org.apache.opennlp:opennlp-tools, mavenGitHub
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>1.9.5</version></dependency> - 2.5.9Apache OpenNLPCVE List
- 3.0.0-M3Apache OpenNLPCVE List
- 1.9.5Apache OpenNLPCVE List
Show all 9 fixed versions
- 2.5.9org.apache.opennlp:opennlp-tools, MavenOSV
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>2.5.9</version></dependency> - 3.0.0-M3org.apache.opennlp:opennlp-tools, MavenOSV
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>3.0.0-M3</version></dependency> - 1.9.5org.apache.opennlp:opennlp-tools, MavenOSV
<dependency><groupId>org.apache.opennlp</groupId><artifactId>opennlp-tools</artifactId><version>1.9.5</version></dependency>
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
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.
Text from GitHub Advisory Database
Affected versions 47
- org.apache.opennlp:opennlp-tools, maven>= 3.0.0-M1, < 3.0.0-M3GitHub
- org.apache.opennlp:opennlp-tools, maven>= 2.0.0, < 2.5.9GitHub
- org.apache.opennlp:opennlp-tools, maven< 1.9.5GitHub
- Apache OpenNLPaffected: 2.0 before 2.5.9CVE List
- Apache OpenNLPaffected: 3.0.0-M1 before 3.0.0-M3CVE List
- Apache OpenNLPaffected: all versions before 1.9.5CVE List
- org.apache.opennlp:opennlp-tools, Mavenfrom 2.0.0, fixed in 2.5.9OSV
- org.apache.opennlp:opennlp-tools, Maven2.0.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.1.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.1.1OSV
- org.apache.opennlp:opennlp-tools, Maven2.2.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.3.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.3.1OSV
- org.apache.opennlp:opennlp-tools, Maven2.3.2OSV
- org.apache.opennlp:opennlp-tools, Maven2.3.3OSV
- org.apache.opennlp:opennlp-tools, Maven2.4.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.0OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.1OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.2OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.3OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.4OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.5OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.6OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.6.1OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.7OSV
- org.apache.opennlp:opennlp-tools, Maven2.5.8OSV
- org.apache.opennlp:opennlp-tools, Mavenfrom 3.0.0-M1, fixed in 3.0.0-M3OSV
- org.apache.opennlp:opennlp-tools, Maven3.0.0-M1OSV
- org.apache.opennlp:opennlp-tools, Maven3.0.0-M2OSV
- org.apache.opennlp:opennlp-tools, Mavenfrom first release, fixed in 1.9.5OSV
- org.apache.opennlp:opennlp-tools, Maven1.5.1-incubatingOSV
- org.apache.opennlp:opennlp-tools, Maven1.5.2-incubatingOSV
- org.apache.opennlp:opennlp-tools, Maven1.5.3OSV
- org.apache.opennlp:opennlp-tools, Maven1.6.0OSV
- org.apache.opennlp:opennlp-tools, Maven1.7.0OSV
- org.apache.opennlp:opennlp-tools, Maven1.7.1OSV
- org.apache.opennlp:opennlp-tools, Maven1.7.2OSV
- org.apache.opennlp:opennlp-tools, Maven1.8.0OSV
- org.apache.opennlp:opennlp-tools, Maven1.8.1OSV
- org.apache.opennlp:opennlp-tools, Maven1.8.2OSV
- org.apache.opennlp:opennlp-tools, Maven1.8.3OSV
- org.apache.opennlp:opennlp-tools, Maven1.8.4OSV
- org.apache.opennlp:opennlp-tools, Maven1.9.0OSV
- org.apache.opennlp:opennlp-tools, Maven1.9.1OSV
- org.apache.opennlp:opennlp-tools, Maven1.9.2OSV
- org.apache.opennlp:opennlp-tools, Maven1.9.3OSV
- org.apache.opennlp:opennlp-tools, Maven1.9.4OSV
References 6
- lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6Advisoryvia CVE List
- access.redhat.com/security/cve/CVE-2026-40682Advisoryvia CVE List
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40682.jsonAdvisoryvia CVE List
- github.com/advisories/GHSA-4v8g-86x5-3vrcAdvisoryvia GitHub
- nvd.nist.gov/vuln/detail/CVE-2026-40682Referencevia GitHub
- bugzilla.redhat.com/show_bug.cgi?id=2466484Referencevia CVE List