All vulnerabilities

PyPI

CVE-2026-126304

NLTK: Symlink escape in YCOECorpusReader lets a psd/pos directory symlink read files outside the corpus root within the data sandbox

Severity
High 8.7
Published
13 Nov 2026
Last changed
18 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.10.4
Exploit chance
0.6% in the next 30 daysHigher than 50% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Link following (CWE-59)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Also known as
GHSA-qg35-44qx-7vrr
Sources
CVE Program, OSV.dev and GitHub

Description

YCOECorpusReader builds two nested corpus sub-readers whose roots are derived from self.root.join("psd") and self.root.join("pos") (nltk/corpus/reader/ycoe.py). Because FileSystemPathPointer.join() (nltk/data.py) performs a purely lexical containment check and never resolves symlinks, and because CorpusReader.init (nltk/corpus/reader/api.py) validates a sub-reader root only against the global NLTK data sandbox and not against the enclosing corpus root, a directory symlink named psd or pos planted inside a YCOE corpus lets the reader anchor its nested sub-readers outside the YCOE corpus root. An attacker who controls the contents of a YCOE corpus loaded under pathsec.ENFORCE=True can make parsed_sents(), tagged_words(), and related methods return file content from other locations inside the allowed data sandbox, defeating the per-corpus-root containment boundary the pathsec controls are meant to enforce.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
nltkPyPI · osv:PyPI:nltk
  • From 3.10.0 before 3.10.4

About nltk

Weekly downloads (PyPI)
11,948,568PyPI Stats, 23 Nov 2026

References