CVE-2026-12252: Nltk NLTK Stanford Wrapper Classes Execute Vulnerability
HIGHCVE-2026-12252 is a HIGH (CVSS 7.8) nltk stanford wrapper classes execute vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Nltk libraries in the PyPI ecosystem. The issue involves nltk stanford wrapper classes execute untrusted jar files without verification. Remediation is available by upgrading affected packages to version 3.9.4.
CVE-2026-12252 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-12252
To remediate this vulnerability, upgrade all affected Nltk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install nltk>=3.9.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show nltk
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-12252, inspect your installed packages using pip:
pip show nltk
Analyze the terminal output to locate any version of Nltk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.9.4), your application is affected.
Note: The pip show nltk command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Nltk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-12252 Affected Nltk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nltk
|
PyPI |
< 3.9.4
|
3.9.4
|
References
Frequently Asked Questions
What is CVE-2026-12252?
Which Nltk versions are affected?
What version fixes CVE-2026-12252?
Is nltk affected?
What is the CVSS score of CVE-2026-12252?
What CWE is associated with CVE-2026-12252?
How can I check PyPI dependencies for CVE-2026-12252?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9r6g-266r-89x4",
"modified" : "2026-10-02T18:30:17Z",
"published" : "2026-07-04T03:31:03Z",
"aliases" : [ "CVE-2026-12252" ],
"summary" : "NLTK Stanford wrapper classes execute untrusted JAR files without verification",
"details" : "In nltk/nltk versions 3.9.3 and earlier, five Stanford interface classes (StanfordPOSTagger, StanfordNERTagger, StanfordParser, StanfordDependencyParser, and StanfordNeuralDependencyParser) are vulnerable to untrusted JAR code execution. These classes accept user-controllable JAR paths and execute them via the `java()` function, which invokes `subprocess.Popen()` without integrity verification. This vulnerability is identical to CVE-2026-0848, which was fixed for StanfordSegmenter by adding SHA256 verification. However, the fix was not applied to these additional classes, leaving them susceptible to arbitrary code execution when loading untrusted JAR files.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "nltk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.9.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12252"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/pull/3743"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/commit/006f4b83d430147b067b81e2cddd226d6fa405c8"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/commit/24777f0cb8c33ed2839d16e0f8169a3c312a6806"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nltk/nltk"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/releases/tag/v3.10.3"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-2085.yaml"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/f5c93982-0cc9-4e2e-bb85-1b6ab29a2efb"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-02T18:30:17Z",
"nvd_published_at" : "2026-07-04T02:16:23Z"
}
}