CVE-2026-12243: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in nltk nltk/nltk
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.
AI Analysis
Technical Summary
CVE-2026-12243 is a path traversal vulnerability in NLTK version 3.9.4 caused by an incomplete fix for a prior issue. The regex `_UNSAFE_NO_PROTOCOL_RE` in nltk/data.py checks for literal '../' sequences but does not detect percent-encoded traversal sequences like '..%2f'. Since the `url2pathname()` function decodes these sequences after the validation step, an attacker can bypass the pathname restriction and cause arbitrary file reads by controlling the resource name parameter passed to `nltk.data.load()` or `nltk.data.find()`. The vulnerability is exacerbated by the default setting `pathsec.ENFORCE=False`, which does not block file reads at the open() stage. This issue affects any application relying on NLTK for resource loading.
Potential Impact
An attacker can read arbitrary files accessible to the Python process by exploiting the path traversal vulnerability in NLTK 3.9.4. This can lead to unauthorized disclosure of sensitive information. There is no indication of integrity or availability impact. The vulnerability is remotely exploitable without privileges or user interaction.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, users should avoid using NLTK version 3.9.4 in untrusted environments or restrict access to sensitive files. Consider setting `pathsec.ENFORCE=True` if applicable to block unauthorized file reads at the open() stage. Monitor official NLTK channels for updates and apply patches once released.
CVE-2026-12243: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in nltk nltk/nltk
Description
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.
CVSS v3.0
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-12243 is a path traversal vulnerability in NLTK version 3.9.4 caused by an incomplete fix for a prior issue. The regex `_UNSAFE_NO_PROTOCOL_RE` in nltk/data.py checks for literal '../' sequences but does not detect percent-encoded traversal sequences like '..%2f'. Since the `url2pathname()` function decodes these sequences after the validation step, an attacker can bypass the pathname restriction and cause arbitrary file reads by controlling the resource name parameter passed to `nltk.data.load()` or `nltk.data.find()`. The vulnerability is exacerbated by the default setting `pathsec.ENFORCE=False`, which does not block file reads at the open() stage. This issue affects any application relying on NLTK for resource loading.
Potential Impact
An attacker can read arbitrary files accessible to the Python process by exploiting the path traversal vulnerability in NLTK 3.9.4. This can lead to unauthorized disclosure of sensitive information. There is no indication of integrity or availability impact. The vulnerability is remotely exploitable without privileges or user interaction.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, users should avoid using NLTK version 3.9.4 in untrusted environments or restrict access to sensitive files. Consider setting `pathsec.ENFORCE=True` if applicable to block unauthorized file reads at the open() stage. Monitor official NLTK channels for updates and apply patches once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2026-06-15T06:24:30.096Z
- Cvss Version
- 3.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a431a1b27e9c7971945a790
Added to database: 06/30/2026, 01:21:31 UTC
Last enriched: 07/07/2026, 11:59:04 UTC
Last updated: 08/13/2026, 12:41:08 UTC
Views: 185
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.