Skip to content
Heist/ feed
Back to feed
Critical

Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading

Type: advisorySources: OSV

NLTK versions <=3.9.2 are vulnerable to arbitrary code execution due to improper input validation in the StanfordSegmenter module. The module dynamically loads external Java .jar files without verification or sandboxing. An attacker can supply or replace the JAR file, enabling the execution of arbitrary Java bytecode at import time. This vulnerability can be exploited through methods such as model poisoning, MITM attacks, or dependency poisoning, leading to remote code execution. The issue arises from the direct execution of the JAR file via subprocess with unvalidated classpath input, allowing malicious classes to execute when loaded by the JVM.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-0848
Confirmed fixed CVEs
Not specified
Updated in this feed
6 Nov 2026, 01:23 UTC · Revision 1

Source evidence

Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading

core-osv · Original source

Published 5 Mar 2026, 20:48 UTC

NLTK versions <=3.9.2 are vulnerable to arbitrary code execution due to improper input validation in the StanfordSegmenter module. The module dynamically loads external Java .jar files without verification or sandboxing. An attacker can supply or replace the JAR file, enabling the execution of arbitrary Java bytecode at import time. This vulnerability can be exploited through methods such as model poisoning, MITM attacks, or dependency poisoning, leading to remote code execution. The issue arises from the direct execution of the JAR file via subprocess with unvalidated classpath input, allowing malicious classes to execute when loaded by the JVM.

osv:CVE-2026-0848
Complete source record
{
  "id": "07874a7a95d27f8e01c6b9b72db804f3c869ef677b7379f9dec456ca22c2b086",
  "url": "https://osv.dev/vulnerability/CVE-2026-0848",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading",
    "summary": "NLTK versions <=3.9.2 are vulnerable to arbitrary code execution due to improper input validation in the StanfordSegmenter module. The module dynamically loads external Java .jar files without verification or sandboxing. An attacker can supply or replace the JAR file, enabling the execution of arbitrary Java bytecode at import time. This vulnerability can be exploited through methods such as model poisoning, MITM attacks, or dependency poisoning, leading to remote code execution. The issue arises from the direct execution of the JAR file via subprocess with unvalidated classpath input, allowing malicious classes to execute when loaded by the JVM.",
    "evidence": "osv:CVE-2026-0848",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2026-0848",
      "aliases": [
        "CVE-2026-0848",
        "PYSEC-2026-99"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nltk/nltk",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "4e17ea390c526ec9cb9e5ef5eb3733ac118dbb8d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "3.9.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.9.2",
            "3.9.2",
            "3.9.1",
            "3.9",
            "3.8.2",
            "3.8.1",
            "3.8",
            "3.7",
            "3.6.7",
            "3.6.6",
            "3.6.5",
            "3.6.2",
            "3.6.1",
            "3.6",
            "3.5",
            "3.5b1",
            "3.4.4",
            "3.4.3",
            "3.4.1",
            "3.4",
            "3.3",
            "3.2.5",
            "3.2.4",
            "3.2.3",
            "3.2.2",
            "3.2.1",
            "3.2",
            "3.1",
            "3.0.5",
            "3.0.4",
            "3.0.3",
            "3.0.2",
            "3.0.0b1",
            "3.0a4",
            "2.0.1rc4",
            "2.0.1rc3",
            "2.0.1rc2",
            "2.0.1rc1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-0848.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:45.599362066Z",
      "provider": "osv",
      "references": [
        "https://huntr.com/bounties/08b109bb-ac24-403f-9422-1c246ce60202",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/0xxx/CVE-2026-0848.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-0848"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-20"
        ],
        "cna_assigner": "@huntr_ai",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/0xxx/CVE-2026-0848.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-0848",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 513822,
  "published_at": "2026-03-05T20:48:05.364+00:00"
}