{"api_version":"1","generated_at":"2026-05-05T15:59:42+00:00","cve":"CVE-2026-40682","urls":{"html":"https://cve.report/CVE-2026-40682","api":"https://cve.report/api/cve/CVE-2026-40682.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-40682","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-40682"},"summary":{"title":"Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor","description":"XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor\n\n\nVersions Affected: before 2.5.9, before 3.0.0-M3\n\n\nDescription: 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.\n\n\nMitigation: 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.","state":"PUBLISHED","assigner":"apache","published_at":"2026-05-04 17:16:23","updated_at":"2026-05-04 18:16:29"},"problem_types":["CWE-611","CWE-611 CWE-611 Improper Restriction of XML External Entity Reference"],"metrics":[],"references":[{"url":"http://www.openwall.com/lists/oss-security/2026/05/01/19","name":"http://www.openwall.com/lists/oss-security/2026/05/01/19","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6","name":"https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6","refsource":"security@apache.org","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-40682","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40682","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Apache Software Foundation","product":"Apache OpenNLP","version":"affected 2.5.9 semver","platforms":[]},{"source":"CNA","vendor":"Apache Software Foundation","product":"Apache OpenNLP","version":"affected 3.0 3.0.0-M3 semver","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[{"source":"CNA","value":"Subramanian S","lang":"en"}],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"providerMetadata":{"dateUpdated":"2026-05-04T17:36:52.681Z","orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE"},"references":[{"url":"http://www.openwall.com/lists/oss-security/2026/05/01/19"}],"title":"CVE Program Container"}],"cna":{"affected":[{"collectionURL":"https://repo.maven.apache.org/maven2/","defaultStatus":"unaffected","packageName":"org.apache.opennlp:opennlp-tools","product":"Apache OpenNLP","vendor":"Apache Software Foundation","versions":[{"lessThan":"2.5.9","status":"affected","version":"0","versionType":"semver"},{"lessThan":"3.0.0-M3","status":"affected","version":"3.0","versionType":"semver"}]}],"credits":[{"lang":"en","type":"finder","value":"Subramanian S"}],"descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor</strong></p>\n<p><strong>Versions Affected:</strong> before 2.5.9, before 3.0.0-M3</p>\n<p><strong>Description:</strong> The <code>DictionaryEntryPersistor</code> class initializes a static <code>SAXParserFactory</code> at class-load time without enabling <code>FEATURE_SECURE_PROCESSING</code> or disabling DTD processing. When <code>create(InputStream, EntryInserter)</code> is invoked, the only feature set on the <code>XMLReader</code> 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 <code>file://</code> entity references or server-side request forgery via <code>http://</code> entity references during SAX parsing, before the application processes a single dictionary entry. This is inconsistent with the project's own <code>XmlUtil.createSaxParser()</code> helper, which correctly sets <code>FEATURE_SECURE_PROCESSING</code> and <code>disallow-doctype-decl</code> and is used by all other XML parsing paths in the codebase. The public <code>Dictionary(InputStream)</code> constructor delegates directly to this method and is the documented API for loading user-supplied dictionaries, making untrusted input a realistic scenario.</p>\n<p><strong>Mitigation:</strong> 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 <code>Dictionary(InputStream)</code> constructor with input validation that rejects any XML containing a DOCTYPE declaration before it reaches the parser.<br></p>"}],"value":"XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor\n\n\nVersions Affected: before 2.5.9, before 3.0.0-M3\n\n\nDescription: 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.\n\n\nMitigation: 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."}],"metrics":[{"other":{"content":{"text":"moderate"},"type":"Textual description of severity"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-611","description":"CWE-611 Improper Restriction of XML External Entity Reference","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-05-04T16:55:55.834Z","orgId":"f0158376-9dc2-43b6-827c-5f631a4d8d09","shortName":"apache"},"references":[{"tags":["vendor-advisory"],"url":"https://lists.apache.org/thread/r6jpt0qr9nj67gqhppqg7jxf8vsbo0w6"}],"source":{"discovery":"EXTERNAL"},"title":"Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPersistor","x_generator":{"engine":"Vulnogram 0.2.0"}}},"cveMetadata":{"assignerOrgId":"f0158376-9dc2-43b6-827c-5f631a4d8d09","assignerShortName":"apache","cveId":"CVE-2026-40682","datePublished":"2026-05-04T16:55:55.834Z","dateReserved":"2026-04-14T17:21:09.189Z","dateUpdated":"2026-05-04T17:36:52.681Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-05-04 17:16:23","lastModifiedDate":"2026-05-04 18:16:29","problem_types":["CWE-611","CWE-611 CWE-611 Improper Restriction of XML External Entity Reference"],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"40682","Ordinal":"1","Title":"Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPer","CVE":"CVE-2026-40682","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"40682","Ordinal":"1","NoteData":"XML External Entity (XXE) via Unsanitized Dictionary Parsing in Apache OpenNLP DictionaryEntryPersistor\n\n\nVersions Affected: before 2.5.9, before 3.0.0-M3\n\n\nDescription: 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.\n\n\nMitigation: 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.","Type":"Description","Title":"Apache OpenNLP: XXE via Dictionary Parsing in DictionaryEntryPer"}]}}}