CVE-2026-129233
NLTK 3.10.0‑3.10.3 reveals out‑of‑root file metadata via os.stat path.
- CVSS 5.3
- CWE-200
- Information Leakage
- Local
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, StreamBackedCorpusView performs os.stat on a caller-supplied plain string path during construction before pathsec containment is enforced. The PathPointer branch used by in-tree corpus readers is validated, so exploitation requires application code to pass an attacker-influenced string directly to the public constructor. That string can identify an out-of-root path and disclose its existence, size, and modification time even though opening the file would be rejected. This issue is fixed in version 3.10.4.
- CWE
- CWE-200
- CVSS base score
- 5.3
- Published
- 2026-11-19
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Local
- Impact
- Information Disclosure
- Affected component
- NLTK
- Fixed by upgrading
- Yes
Solution
Upgrade NLTK to version 3.10.4 or later.
Vulnerable code sample
import os
from nltk.corpus.reader.util import StreamBackedCorpusView
def load_corpus(corpus_path: str):
# VULNERABLE: os.stat on attacker-controlled path leaks existence info
view = StreamBackedCorpusView(corpus_path, lambda _: None)
return list(view)Patched code sample
import os
from pathlib import Path
from nltk.corpus.reader.util import StreamBackedCorpusView
def load_corpus(corpus_path: str):
# FIX: validate path containment before any filesystem query
base = Path("/usr/share/nltk_data/corpora")
target = Path(corpus_path).resolve()
if not str(target).startswith(str(base)):
raise ValueError("Path outside allowed corpus directory")
view = StreamBackedCorpusView(str(target), lambda _: None)
return list(view)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.
- Defer the corpus-view refusal to _open and scope the YCOE guard for tests (nltk/nltk)
nltk/corpus/reader/util.py,nltk/corpus/reader/util.py · StreamBackedCorpusView._open,nltk/corpus/reader/util.py · StreamBackedCorpusView.__init__,nltk/corpus/reader/ycoe.py,nltk/corpus/reader/ycoe.py · YCOECorpusReader.__init__ - Enforce corpus-root containment in YCOE reader and StreamBackedCorpusView (nltk/nltk)
nltk/corpus/reader/util.py,nltk/corpus/reader/util.py · StreamBackedCorpusView.__init__,nltk/corpus/reader/ycoe.py · YCOECorpusReader.__init__
Cite this entry
@misc{vaitp:cve2026129233,
title = {{NLTK 3.10.0‑3.10.3 reveals out‑of‑root file metadata via os.stat path.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-129233},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-129233/}}
}
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 ::
