CVE-2026-128136
NLTK 3.10.0‑3.10.3 bypass lets pickle run numpy I/O, enabling file write.
- CVSS 6.1
- CWE-502
- Input Validation and Sanitization
- Remote
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. From 3.10.0 until 3.10.4, allowlisted_pickle_load keys dangerous NumPy globals by export name, allowing submodule-local numpy.lib file input/output callables to evade the denylist under the broad module allowance used by TransitionParser. A crafted pickle can invoke recfromtxt to read a local file or open_memmap to create or truncate an attacker-selected file when a victim loads an untrusted model. This issue is fixed in version 3.10.4.
- CWE
- CWE-502
- CVSS base score
- 6.1
- Published
- 2026-11-19
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Serialization Issues
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- NLTK
- Fixed by upgrading
- Yes
Solution
Upgrade NLTK to version 3.10.4 or newer.
Vulnerable code sample
import nltk
import pickle
def load_model(path: str):
# VULNERABLE: allows dangerous NumPy globals via allowlisted_pickle_load
with open(path, "rb") as f:
return nltk.data.load(f, allow_pickle=True)Patched code sample
import nltk
import pickle
def load_model(path: str):
# FIX: disallow pickle loading of NumPy globals
with open(path, "rb") as f:
return nltk.data.load(f, allow_pickle=False)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Harden the untrusted-model pickle allowlist (exact globals + numpy.lib denylist) (nltk/nltk)
nltk/parse/transitionparser.py,nltk/parse/transitionparser.py · TransitionParser.parse,nltk/parse/transitionparser.py · TransitionParser.train,nltk/picklesec.py
Cite this entry
@misc{vaitp:cve2026128136,
title = {{NLTK 3.10.0‑3.10.3 bypass lets pickle run numpy I/O, enabling file write.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128136},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128136/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
