CVE-2026-71514: NLTK 3.9.4 through 3.10.2 Path Traversal via CrubadanCorpusReader pathsec Bypass

Published Aug 22, 2026
·
Updated

NLTK 3.9.4 through 3.10.2 contains a path traversal vulnerability in CrubadanCorpusReader. loadlangngrams joins the corpus root with crubadancode, 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 langfreq, limited to paths ending in -3grams.txt whose contents parse as token count lines.

Affected Software

1 affected component
nltk nltk>=3.9.4<=3.10.2

Event History

Aug 22, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is realistically exposed to this issue?

Applications using NLTK 3.9.4 through 3.10.2 and loading a Crubadan corpus package whose table.txt mapping file is attacker-controlled are exposed. The affected path is reached when CrubadanCorpusReader loads language n-grams through lang_freq.

2

What does an attacker need to exploit it?

The attacker must control a corpus package, including the column-0 crubadan_code value in table.txt, and induce a user to use it. The crafted value must point to a path ending in -3grams.txt, and the target file's contents must parse as token-count lines.

3

Does enabling NLTK pathsec enforcement prevent exploitation?

No. The vulnerable code uses the builtin open() after joining the corpus root and crubadan_code, rather than the pathsec-validated opener, so an absolute value can bypass the containment check even when nltk.pathsec enforcement is enabled.

4

How can I determine whether a corpus package is malicious or affected?

Inspect the package's table.txt mapping file for column-0 crubadan_code values that are absolute paths or otherwise resolve outside the corpus root. Also review whether those entries reference files ending in -3grams.txt, since those are the files the vulnerable loader attempts to read.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203