CVE-2026-12243
Python vulnerability analysis and mitigation

Overview

CVE-2026-12243 is a path traversal vulnerability in NLTK (Natural Language Toolkit) version 3.9.4 that allows unauthenticated remote attackers to read arbitrary files accessible to the Python process. The flaw stems from an incomplete fix for GitHub Issue #3504, where the _UNSAFE_NO_PROTOCOL_RE regex in nltk/data.py fails to account for percent-encoded traversal sequences (e.g., ..%2f). It was published on June 30, 2026, and carries a CVSS v3.0 base score of 7.5 (High) (GitHub Advisory, Red Hat Bugzilla).

Technical details

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), specifically a validation bypass via URL encoding (CAPEC-64, CAPEC-78). The _UNSAFE_NO_PROTOCOL_RE regex in nltk/data.py checks only for literal ../ sequences, but the url2pathname() function decodes percent-encoded sequences (e.g., ..%2f../) after the validation step, allowing the check to be trivially bypassed. An attacker who can control the resource parameter passed to nltk.data.load() or nltk.data.find() — for example, via a web API backed by an NLP application — can supply a crafted path to read arbitrary files. The default pathsec.ENFORCE=False configuration means no secondary protection blocks the file read at the open() stage (GitHub Advisory, Huntr Bounty).

Impact

Successful exploitation results in unauthorized disclosure of arbitrary files readable by the Python process running NLTK, including sensitive configuration files, credentials, private keys, or application source code. The vulnerability has no impact on integrity or availability, but the confidentiality impact is rated High. Affected application types include NLP web applications, Jupyter notebooks, and CLI tools that expose NLTK resource loading to external input (GitHub Advisory, Red Hat Bugzilla).

Exploitation steps

  1. Reconnaissance: Identify web applications, APIs, or services that use NLTK version 3.9.4 for resource loading and accept user-controlled input passed to nltk.data.load() or nltk.data.find().
  2. Craft malicious resource name: Construct a path traversal payload using percent-encoded sequences to bypass the _UNSAFE_NO_PROTOCOL_RE regex, e.g., ..%2f..%2f..%2fetc%2fpasswd instead of ../../../etc/passwd.
  3. Submit payload: Send the crafted resource name as input to the vulnerable application endpoint (e.g., via HTTP request parameter, API call, or CLI argument) that passes it to nltk.data.load() or nltk.data.find().
  4. Bypass validation: The regex check passes because it only matches literal ../; the url2pathname() function subsequently decodes %2f to /, resolving the traversal path.
  5. Read arbitrary file: With pathsec.ENFORCE=False (the default), no secondary check blocks the open() call, and the contents of the targeted file are returned to the attacker (Huntr Bounty, GitHub Advisory).

Indicators of compromise

  • Network: HTTP requests containing percent-encoded path traversal sequences (e.g., ..%2f, ..%252f) in parameters that are passed to NLTK resource loading functions; unusual outbound data transfers from NLP application servers.
  • Logs: Application logs showing nltk.data.load() or nltk.data.find() calls with resource names containing %2f, %252f, or other encoded slash variants; file access log entries for sensitive system files (e.g., /etc/passwd, /etc/shadow, application config files) by the Python process.
  • File System: No direct file system artifacts are expected from read-only exploitation, but unexpected access timestamps on sensitive files may indicate reconnaissance activity.
  • Process: Python process accessing files outside the expected NLTK data directory (e.g., /usr/share/nltk_data or ~/nltk_data) as observed via system call tracing (strace, auditd) (GitHub Advisory, Red Hat Bugzilla).

Mitigation and workarounds

Upgrade NLTK to a patched version that properly validates percent-encoded path traversal sequences (check the official NLTK repository for the fixed release). As an immediate workaround, set pathsec.ENFORCE=True in your application to add a secondary protection layer that blocks unsafe file reads at the open() stage. Additionally, restrict and validate resource names passed to nltk.data.load() and nltk.data.find() using an allowlist of expected values, and avoid exposing these functions to untrusted user input (GitHub Advisory, Red Hat Bugzilla).

Community reactions

Red Hat has tracked this vulnerability via their Bugzilla system (Bug 2494748) with a high severity/priority rating and assigned it to their Product Security DevOps Team, indicating active triage for downstream impact on Red Hat products. The vulnerability was disclosed through the Huntr bug bounty platform and received coverage from automated CVE tracking services. No notable independent researcher commentary or significant social media discussion beyond standard CVE aggregation has been identified at this time (Red Hat Bugzilla, Huntr Bounty).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hmj8-5xmh-5573HIGH7.5
  • Python logoPython
  • libp2p
NoNoJul 24, 2026
GHSA-94p4-4cq8-9g67HIGH7.5
  • Python logoPython
  • gitpython
NoYesJul 24, 2026
GHSA-47w6-gwp4-w6vcHIGH7.1
  • Python logoPython
  • vantage6
NoNoJul 24, 2026
CVE-2026-59714HIGH7.1
  • Python logoPython
  • open-webui
NoYesJul 24, 2026
GHSA-464c-974j-9xm6LOW3.3
  • JavaScript logoJavaScript
  • software.amazon.awscdk:aws-cdk-lib
NoYesJul 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management