Patch Forecast
Amber warning
Patch this week.

CVE-2026-62388 · GHSA-p3m8-78j2-g5p3

NLTK: Default ENFORCE=False Disables All pathsec Security Controls

Risk score
62/100
CVSS
8.7 v4.0
Published
2 Sep 2026

Open in the live forecast Today's forecast

What to know

What it is
NLTK's pathsec.py security module defaults to ENFORCE=False (line 24), which means all 8 security validation functions only emit RuntimeWarning instead of raising exceptions when violations are detected. The pathsec module was introduced as the fix for CVE-2024-39705 (arbitrary code execution via pickle) and CVE-2026-…
Affected
nltk (pip) <= 3.9.4
Fix
Upgrade nltk to 3.10.0 or later.
Exploitation
No known exploitation

Story map

Story map: nltkTHE FLAWSTHE FIXCVE-2026-62388NLTK: Default ENFORCE=FalseDisables All pathsec SecurityControlsCVSS 8.7GHSA-j456-xh4h-cpf2NLTK: WekaClassifier passes anunvalidated caller-controlledmodel path to the weka JVM…CVSS 8.6CVE-2026-63311NLTK: SSRF Fail-Open invalidate_network_url() via DNSResolution FailureCVSS 6.9FixUpgrade to version 3.10.4 orlaterWho is exposed{'products': ['NLTK'],'packages': [{'ecosystem': 'pip','name': 'nltk', 'vulnerable': '<=3.10.3', 'patched': '3.10.4'}]}AMBER · PATCH THIS WEEKnltkThe NLTK library'sWekaClassifier passesunvalidated caller-controlledmodel paths to the weka JVM,allowing an attacker to bypasscontainment and potentiallywrite arbitrary files or…Where it standsPublic proof of conceptCONNECTS TOSame weaknessCWE-1188 (CWE-1188)33 other warnings in 30 days →
Story map: the flaws, the fix, how it unfolded and what it connects to. Boxes link to the record or article.

At a glance

nltk: Amber, patch this week. The NLTK library's WekaClassifier passes unvalidated caller-controlled model paths to the weka JVM, allowing an attacker to bypass containment and potentially write arbitrary files or read/parse files from any location.

The flaws

  • CVE-2026-62388: NLTK: Default ENFORCE=False Disables All pathsec Security Controls (CVSS 8.7)
  • GHSA-j456-xh4h-cpf2: NLTK: WekaClassifier passes an unvalidated caller-controlled model path to the weka JVM, bypassing nltk.pathsec containment (CVSS 8.6)
  • CVE-2026-63311: NLTK: SSRF Fail-Open in validate_network_url() via DNS Resolution Failure (CVSS 6.9)

The fix

Fix: Upgrade to version 3.10.4 or later

Who is exposed: {'products': ['NLTK'], 'packages': [{'ecosystem': 'pip', 'name': 'nltk', 'vulnerable': '<= 3.10.3', 'patched': '3.10.4'}]}

Where it stands

  • Public proof of concept

Connects to

Why it is Amber

  • CVSS 8.7 high
  • Remotely exploitable without logging in
  • On your watchlist: PyPI

Affected packages

PackageEcosystemVulnerableFixed in
nltkpip<= 3.9.43.10.0

References

Original description

NLTK's pathsec.py security module defaults to ENFORCE=False (line 24), which means all 8 security validation functions only emit RuntimeWarning instead of raising exceptions when violations are detected. The pathsec module was introduced as the fix for CVE-2024-39705 (arbitrary code execution via pickle) and CVE-2026-0846 (path traversal). However, with ENFORCE=False as the default: 1. pathsec.open('/etc/passwd') succeeds (reads the file, emits warning) 2. pathsec.validate_network_url('http://169.254.169.254/...') succeeds (warning only) 3. pickle.loads() via nltk.data.load() proceeds despite unsafe source (warning only) Every security gate follows the same pattern: ```python ENFORCE = os.environ.get('NLTK_PATHSEC_ENFORCE', '').lower() in ('1', 'true', 'yes') def validate_something(path): if is_violation(path): if ENFORCE: raise SecurityError('...') # Only raised when env var is set else: warnings.warn('...', RuntimeWarning) # Default: warning only # Execution continues regardless ``` This means the security remediations for CVE-2024-39705 and CVE-2026-0846 are effectively disabled by default. Any user who installed NLTK 3.9.x expecting the security fixes to be active is still vulnerable unless they manually set NLTK_PATHSEC_ENFORCE=1. PoC: ```python import nltk.pathsec import warnings # Show that ENFORCE is False by default print(f'ENFORCE = {nltk.pathsec.ENFORCE}') # False # Attempt to read /etc/passwd through pathsec -- should be blocked with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') result = nltk.pathsec.open('/etc/passwd', 'r') print(f'File opened: {result.name}') # /etc/passwd print(f'Warning emitted: {w[0].message}') # RuntimeWarning (not an exception) # Attack succeeds -- file is readable ``` The correct default is fail-secure: ENFORCE should be True unless explicitly disabled. The current default makes the security module opt-in rather than opt-out, defeating its purpose. Suggested fix: Change default to ENFORCE=True. Users who need backwards compatibility can set NLTK_PATHSEC_ENFORCE=0 to explicitly disable.

Last activity 2 Sep 2026. Patch Forecast updates every hour.