Directory Traversal Affecting py3-nltk package, versions <3.10.0-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.58% (45th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-CHAINGUARDLATEST-PY3NLTK-17896649
  • published9 Jul 2026
  • disclosed30 Jun 2026

Introduced: 30 Jun 2026

CVE-2026-12243  (opens in a new tab)
CWE-22  (opens in a new tab)

How to fix?

Upgrade Chainguard py3-nltk to version 3.10.0-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream py3-nltk package and not the py3-nltk package as distributed by Chainguard. See How to fix? for Chainguard relevant fixed versions and status.

NLTK version 3.9.4 is vulnerable to a path traversal attack due to an incomplete fix for GitHub Issue #3504. The _UNSAFE_NO_PROTOCOL_RE regex in nltk/data.py checks for literal ../ sequences but fails to account for percent-encoded traversal sequences such as ..%2f. The url2pathname() function decodes these sequences after the validation step, allowing an attacker to bypass the protection. This vulnerability enables an attacker to read arbitrary files accessible to the Python process by controlling the resource name parameter passed to nltk.data.load() or nltk.data.find(). The issue affects applications that rely on NLTK for resource loading, including NLP web applications, Jupyter notebooks, and CLI tools. The default pathsec.ENFORCE=False setting exacerbates the impact by not blocking the file read at the open() stage.