Skip to content
Heist/ feed
Back to feed
Critical

apache-opennlp — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-40682

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
1.9.1-2, 1.9.2-1, 1.9.3-1, 1.9.4-1, 2.3.0-1, 2.3.1-1, 2.3.1-2, 2.3.2-1, 2.5.3-1, 2.5.3-1build1, 2.5.9-1
Fixed versions
Not specified
CVEs
CVE-2026-40682
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:25 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-40682

core-osv · Original source

Published 4 May 2026, 17:16 UTC

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:UBUNTU-CVE-2026-40682

apache-opennlp

Fixed versions: Not specified

apache-opennlp

Fixed versions: Not specified

apache-opennlp

Fixed versions: Not specified

apache-opennlp

Fixed versions: Not specified

apache-opennlp

Fixed versions: Not specified

apache-opennlp

Fixed versions: Not specified

Complete source record
{
  "id": "39a46e95d33794f492ae6c589840d50efd2714993ecd4c310c2cb5db78891466",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-40682",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-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:UBUNTU-CVE-2026-40682",
    "products": [
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.9.1-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.9.2-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.9.3-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.9.4-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.3.0-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "2.3.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "2.3.1-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "2.3.2-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.5.3-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.5.3-1build1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.5.9-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "apache-opennlp",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.5.3-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "2.5.3-1build1",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "UBUNTU-CVE-2026-40682",
      "aliases": [
        "UBUNTU-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"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "1.9.1-2",
            "1.9.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "1.9.2-1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "1.9.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "1.9.3-1",
            "1.9.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "1.9.4-1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "1.9.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "2.3.0-1",
            "2.3.1-1",
            "2.3.1-2",
            "2.3.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "2.3.2-1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "2.3.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "2.5.3-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "2.5.3-1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "2.5.3-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2.5.3-1build1",
            "2.5.9-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "2.5.9-1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "2.5.9-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "apache-opennlp",
            "purl": "pkg:deb/ubuntu/apache-opennlp?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2.5.3-1",
            "2.5.3-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40682.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libapache-opennlp-java",
                "binary_version": "2.5.3-1build1"
              },
              {
                "binary_name": "opennlp",
                "binary_version": "2.5.3-1build1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:54:54.123053819Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-40682"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-40682",
        "https://www.cve.org/CVERecord?id=CVE-2026-40682",
        "https://www.openwall.com/lists/oss-security/2026/05/01/19",
        "https://issues.apache.org/jira/browse/OPENNLP-1819",
        "https://github.com/apache/opennlp/pull/1019",
        "https://github.com/apache/opennlp/pull/1020"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-40682",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 353580,
  "published_at": "2026-05-04T17:16:00+00:00"
}