CVE-2026-12243: Path Traversal via Percent-Encoding in nltk.data.find() and nltk.data.load()

Published Jun 30, 2026
·
Updated

NLTK version 3.9.4 is vulnerable to a path traversal attack due to an incomplete fix for GitHub Issue #3504. The UNSAFENOPROTOCOLRE 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.

Affected Software

2 affected components
nltk nltk=3.9.4
nltk nltk=3.9.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nltk to a version that resolves this vulnerability.

    Fixed in 3.9.4Patch GitHub Issue #3504
  2. Configuration

    Set pathsec.ENFORCE to True to enforce blocking file reads at the open() stage (default is ENFORCE=False, which exacerbates the impact).

    nltk.pathsec ENFORCE = True
  3. Compensating control

    As a compensating control, avoid accepting untrusted input for the resource name parameter passed to nltk.data.load() or nltk.data.find(); ensure only trusted, expected resource names/paths are used to prevent percent-encoded path traversal from bypassing validation.

Event History

Jun 30, 2026
CVE Published
via MITRE·12:14 AM
Data Sourced
via MITRE·12:14 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2026-12243?

CVE-2026-12243 is a high severity vulnerability in NLTK version 3.9.4 that allows for path traversal attacks via percent-encoded sequences.

2

How does the path traversal vulnerability work in CVE-2026-12243?

The vulnerability allows attackers to exploit the incomplete fix of percent-encoded traversal sequences, such as `..%2f`, which can bypass security checks.

3

What are the potential impacts of CVE-2026-12243?

Exploitation of CVE-2026-12243 can lead to unauthorized access to files outside of the intended directory structure.

4

How can I fix CVE-2026-12243?

To fix CVE-2026-12243, update to the latest version of NLTK that addresses the path traversal vulnerability.

5

What should I do if I am using NLTK version 3.9.4?

If you are using NLTK version 3.9.4, it is critical to upgrade to a patched version to mitigate the risk of path traversal attacks.

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