CVE-2026-79657
NLTK before 3.10.3 Remote Code Execution via Unsafe Pickle Deserialization
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
9.3
NLTK before 3.10.3 Remote Code Execution via Unsafe Pickle Deserialization
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
CVE-2026-79657- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
EUVDEUVD-2026-65440
9.3
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
EUVD-2026-65440- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-vp9c-2pjm-8925
9.3
Duplicate Advisory: Allowlisted pickle loaders still permit code execution in current source
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-x99w-6fgc-pmfw. This link is maintained to preserve external references.
Original Description
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
GHSA-vp9c-2pjm-8925- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-x99w-6fgc-pmfw
9.3
NLTK: Allowlisted pickle loaders still permit code execution in current source
Summary
The current source tree still allows arbitrary code execution during supposedly safer allowlisted pickle loading. The allowlist trusts whole module namespaces instead of exact safe globals, so crafted pickles can invoke dangerous in-namespace callables through pickle REDUCE.
Details
- Vulnerability type: Remote code execution via unsafe deserialization
- Affected component:
nltk.picklesec.allowlisted_pickle_load,nltk.tokenize.punkt.punkt_pickle_load,nltk.parse.transitionparser.TransitionParser.parse - Affected versions: Current source
v3.10.0-rc2; published3.9.4was not the claim target for this bypass. - Patched versions: Not yet patched
- Root cause: Module-prefix allowlists include dangerous callables such as
nltk.tokenize.repp.ReppTokenizer._executeandnumpy.f2py.crackfortran.myeval.
punkt_pickle_load() allowlists both nltk.tokenize.punkt and the whole nltk.tokenize namespace, which exposes ReppTokenizer._execute() and its subprocess.Popen(...) sink during unpickling. TransitionParser.parse() uses allowlisted_pickle_load(..., allowed_modules=("numpy", "scipy", "sklearn")), which permits numpy.f2py.crackfortran.myeval() and its attacker-controlled eval(...) path. I confirmed both gadgets create marker files before the caller returns or later aborts on type misuse.
PoC
Preconditions
- The application loads an attacker-controlled tokenizer or model artifact through these public loaders.
Steps
- Create a pickle whose REDUCE callable is
ReppTokenizer._executeand point its command to a harmless marker-file write. - Pass that payload to
punkt_pickle_load(BytesIO(payload))and observe the marker file is created during unpickling. - Create a second pickle whose REDUCE callable is
numpy.f2py.crackfortran.myevaland load it throughTransitionParser.parse(). - Observe the second marker file is created before
TransitionParser.parse()later fails on the returned object type.
Minimal reproducible excerpt
{'punkt_marker': 'PUNKT_RCE', 'transitionparser_marker': 'TP_RCE'}
Impact
Any caller that trusts these current allowlisted loaders can still execute attacker-controlled commands while loading model or tokenizer artifacts. This defeats the protection mechanism that replaced unrestricted pickle loading and creates a dangerous false sense of safety.
Remediation
Replace broad module-prefix allowlists with exact (module, qualname) pairs for the few safe classes or functions genuinely required. Do not allow entire namespaces such as nltk.tokenize or numpy, and keep post-load type validation only as a secondary defense.
Resources
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tokenize/punkt.py#L120-L134
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tokenize/repp.py#L111-L115
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L26-L30
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L565-L571
Fix + attack demonstration (verified)
- tightened callers
find_classnow, before the allowlists:
- Rejects any dotted
name→ closes 4489 with zero legit impact. - Denies dangerous modules (
os,subprocess,sys,builtins,numpy.f2py,nltk.tokenize.repp, …) even under a broadallowed_modules— a defense-in-depth backstop so a future too-broad allowlist can't silently reopen RCE. builtinsdenied wholesale; safe primitives (int,str, …) must be named exactly viaallowed_globals.
Callers tightened: punkt drops the broad nltk.tokenize (keeps nltk.tokenize.punkt + exact collections.defaultdict/builtins.int); transitionparser keeps numpy/scipy/sklearn (array unpickling needs their submodules) with the new guards blocking the gadgets.
Full pickle-sink audit
Every deserialization sink in the tree was reviewed: no raw pickle.load anywhere, and no…
- Record
GHSA-x99w-6fgc-pmfw- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-502, CWE-693
- Updated
- 2026-11-02
NVD
9.3
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
CVE-2026-79657- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
OSV
9.3
NLTK before 3.10.3 Remote Code Execution via Unsafe Pickle Deserialization
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
CVE-2026-79657- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-502
- Updated
- 2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2026-79657
9.3
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
DEBIAN-CVE-2026-79657- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
OSVGHSA-vp9c-2pjm-8925
9.3
Duplicate Advisory: Allowlisted pickle loaders still permit code execution in current source
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-x99w-6fgc-pmfw. This link is maintained to preserve external references.
Original Description
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
GHSA-vp9c-2pjm-8925- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
OSVGHSA-x99w-6fgc-pmfw
9.3
NLTK: Allowlisted pickle loaders still permit code execution in current source
Summary
The current source tree still allows arbitrary code execution during supposedly safer allowlisted pickle loading. The allowlist trusts whole module namespaces instead of exact safe globals, so crafted pickles can invoke dangerous in-namespace callables through pickle REDUCE.
Details
- Vulnerability type: Remote code execution via unsafe deserialization
- Affected component:
nltk.picklesec.allowlisted_pickle_load,nltk.tokenize.punkt.punkt_pickle_load,nltk.parse.transitionparser.TransitionParser.parse - Affected versions: Current source
v3.10.0-rc2; published3.9.4was not the claim target for this bypass. - Patched versions: Not yet patched
- Root cause: Module-prefix allowlists include dangerous callables such as
nltk.tokenize.repp.ReppTokenizer._executeandnumpy.f2py.crackfortran.myeval.
punkt_pickle_load() allowlists both nltk.tokenize.punkt and the whole nltk.tokenize namespace, which exposes ReppTokenizer._execute() and its subprocess.Popen(...) sink during unpickling. TransitionParser.parse() uses allowlisted_pickle_load(..., allowed_modules=("numpy", "scipy", "sklearn")), which permits numpy.f2py.crackfortran.myeval() and its attacker-controlled eval(...) path. I confirmed both gadgets create marker files before the caller returns or later aborts on type misuse.
PoC
Preconditions
- The application loads an attacker-controlled tokenizer or model artifact through these public loaders.
Steps
- Create a pickle whose REDUCE callable is
ReppTokenizer._executeand point its command to a harmless marker-file write. - Pass that payload to
punkt_pickle_load(BytesIO(payload))and observe the marker file is created during unpickling. - Create a second pickle whose REDUCE callable is
numpy.f2py.crackfortran.myevaland load it throughTransitionParser.parse(). - Observe the second marker file is created before
TransitionParser.parse()later fails on the returned object type.
Minimal reproducible excerpt
{'punkt_marker': 'PUNKT_RCE', 'transitionparser_marker': 'TP_RCE'}
Impact
Any caller that trusts these current allowlisted loaders can still execute attacker-controlled commands while loading model or tokenizer artifacts. This defeats the protection mechanism that replaced unrestricted pickle loading and creates a dangerous false sense of safety.
Remediation
Replace broad module-prefix allowlists with exact (module, qualname) pairs for the few safe classes or functions genuinely required. Do not allow entire namespaces such as nltk.tokenize or numpy, and keep post-load type validation only as a secondary defense.
Resources
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tokenize/punkt.py#L120-L134
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tokenize/repp.py#L111-L115
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L26-L30
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L565-L571
Fix + attack demonstration (verified)
- tightened callers
find_classnow, before the allowlists:
- Rejects any dotted
name→ closes 4489 with zero legit impact. - Denies dangerous modules (
os,subprocess,sys,builtins,numpy.f2py,nltk.tokenize.repp, …) even under a broadallowed_modules— a defense-in-depth backstop so a future too-broad allowlist can't silently reopen RCE. builtinsdenied wholesale; safe primitives (int,str, …) must be named exactly viaallowed_globals.
Callers tightened: punkt drops the broad nltk.tokenize (keeps nltk.tokenize.punkt + exact collections.defaultdict/builtins.int); transitionparser keeps numpy/scipy/sklearn (array unpickling needs their submodules) with the new guards blocking the gadgets.
Full pickle-sink audit
Every deserialization sink in the tree was reviewed: no raw pickle.load anywhere, and no…
- Record
GHSA-x99w-6fgc-pmfw- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-502, CWE-693
- Updated
- 2026-11-02
OSVPYSEC-2026-3735
9.3
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
PYSEC-2026-3735- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-79657
9.3
NLTK versions before 3.10.3 contain a remote code execution vulnerability in allowlisted pickle loaders that trust entire module namespaces instead of specific safe callables. Attackers can craft malicious pickle payloads invoking dangerous in-namespace functions like ReppTokenizer._execute and numpy.f2py.crackfortran.myeval through pickle REDUCE to execute arbitrary commands during model or tokenizer artifact loading.
- Record
UBUNTU-CVE-2026-79657- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2026-0340 No score
Updated python-nltk packages fix security vulnerabilities
Updated packages fix security vulnerabilities. Please see the links.
- Record
MGASA-2026-0340- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
nltkPyPI |
through 3.10.2 | 3.10.3 |
nltkDebian:12 |
All versions, plus listed versions 3.10.0-13.10.1-13.10.3-13.8-13.8.1-1 Show 4 moreShow less3.9.1-13.9.1-23.9.2-13.9.3-1 |
None known |
nltkDebian:13 |
All versions, plus listed versions 3.10.0-13.10.1-13.10.3-13.9.1-23.9.2-13.9.3-1 |
None known |
nltkDebian:14 |
before 3.10.3-1, plus listed versions 3.10.0-13.10.1-13.9.1-23.9.2-13.9.3-1 |
3.10.3-1 |
nltkPyPI |
before 3.10.3, plus listed versions 0.80.90.9.30.9.40.9.5 Show 45 moreShow less0.9.60.9.70.9.80.9.92.0.12.0.1rc12.0.1rc2-git2.0.1rc32.0.1rc42.0.22.0.32.0.42.0.52.0b42.0b52.0b62.0b72.0b82.0b93.0.03.0.0b13.0.0b23.0.13.0.23.0.33.0.43.0.53.13.10.03.10.13.10.23.23.2.13.2.23.2.33.2.43.2.53.33.43.4.13.4.23.4.33.4.43.4.53.5 |
3.10.3 |
python-nltkMageia:10 From an advisory covering 18 CVEs |
before 3.10.3-1.mga10 | 3.10.3-1.mga10 |
python-nltkMageia:9 From an advisory covering 18 CVEs |
before 3.10.3-1.mga9 | 3.10.3-1.mga9 |
nltkUbuntu:Pro:14.04:LTS |
All versions, plus listed versions 2.0~b9-0ubuntu42.0~b9-0ubuntu4.1~esm22.0~b9-0ubuntu4.1~esm42.0~b9-0ubuntu4.1~esm52.0~b9-0ubuntu4.1~esm6 |
None known |
nltkUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 3.0.4-13.0.5-13.1-13.1-1ubuntu0.13.1-1ubuntu0.1+esm13.1-1ubuntu0.1+esm23.1-1ubuntu0.1+esm33.1-1ubuntu0.1+esm4 |
None known |
nltkUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 3.2.4-13.2.5-13.2.5-1ubuntu0.13.2.5-1ubuntu0.1+esm13.2.5-1ubuntu0.1+esm23.2.5-1ubuntu0.1+esm33.2.5-1ubuntu0.1+esm4 |
None known |
Show 4 moreShow less
| Package | Affected | Fixed |
|---|---|---|
nltkUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 3.4.5-13.4.5-23.4.5-2ubuntu0.1~esm13.4.5-2ubuntu0.1~esm23.4.5-2ubuntu0.1~esm33.4.5-2ubuntu0.1~esm4 |
None known |
nltkUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 3.5-13.6.5-13.6.7-13.7-13.7-1ubuntu0.1~esm13.7-1ubuntu0.1~esm2 |
None known |
nltkUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 3.8.1-13.8.1-1ubuntu0.1~esm13.8.1-1ubuntu0.1~esm2 |
None known |
nltkUbuntu:Pro:26.04:LTS |
All versions, plus listed versions 3.9.1-23.9.1-2build13.9.2-13.9.2-1ubuntu0.1~esm13.9.2-1ubuntu0.1~esm2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-79657 is a critical vulnerability (CVSS 9.3) in Nltk, published August 25, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.27%, the 69th percentile. Fixed in nltk 3.10.3.
References
github.com/nltk/nltk/security/advisories/GHSA-x99w-6fgc-pmfw
vulncheck.com/advisories/nltk-before-3.10.3-remote-code-execution-via-unsafe-pickle-deserialization
nvd.nist.gov/vuln/detail/CVE-2026-79657
github.com/advisories/GHSA-vp9c-2pjm-8925
github.com/nltk/nltk/commit/c3e37113742a1ebeeb4f2ca58941f320f98805ea
github.com/nltk/nltk/releases/tag/v3.10.3
Show 10 moreShow less
github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3735.yaml
github.com/advisories/GHSA-x99w-6fgc-pmfw
github.com/CVEProject/cvelistV5/tree/main/cves/2026/79xxx/CVE-2026-79657.json
security-tracker.debian.org/tracker/CVE-2026-79657
github.com/nltk/nltk
advisories.mageia.org/MGASA-2026-0340.html
bugs.mageia.org/show_bug.cgi?id=36186
github.com/nltk/nltk/releases
ubuntu.com/security/CVE-2026-79657
cve.org/CVERecord?id=CVE-2026-79657
Left out here: 18 versions and the rest of 2 source descriptions. The JSON record has them.