Description
NLTK 3.9.4 through 3.10.2 contains a path traversal vulnerability in CrubadanCorpusReader. _load_lang_ngrams joins the corpus root with crubadan_code, the column-0 value read from the corpus table.txt mapping file, and opens the result with the builtin open() rather than the pathsec-validated opener, so os.path.join discards the root when that value is absolute and the read escapes the corpus directory without the containment check nltk.pathsec applies when ENFORCE is set. An attacker who controls a corpus package can disclose file contents outside the corpus root through lang_freq, limited to paths ending in -3grams.txt whose contents parse as token count lines.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| nltk | nltk | 3.9.4 – < 3.10.3 | 3.10.3 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | nltk | 3.10.3-1 | — |
| Debian 13 | nltk | No fix yet | — |
| Debian 12 | nltk | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | nltk | No fix yet | — |
Show 7 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 26.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 24.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 22.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 20.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 18.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 16.04 LTS | nltk | No fix yet | — |
| Ubuntu Pro 14.04 LTS | nltk | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | open-webui | 0.11.3-r1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | nltk | >= 3.9.4, < 3.10.3 | 3.10.3 | GHSA-cv22-g7mw-8v73 |
References
- Patch Commit patch
- https://github.com/nltk/nltk product
- https://github.com/nltk/nltk/blob/v3.10.2/nltk/corpus/reader/crubadan.py#L90-L98 technical-description
- VulnCheck Advisory: NLTK 3.9.4 through 3.10.2 Path Traversal via CrubadanCorpusReader pathsec Bypass third-party-advisory