CVE-2026-62388: NLTK: Default ENFORCE=False Disables All pathsec Security Controls
(updated )
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:
- pathsec.open(’/etc/passwd’) succeeds (reads the file, emits warning)
- pathsec.validate_network_url(‘http://169.254.169.254/…’) succeeds (warning only)
- pickle.loads() via nltk.data.load() proceeds despite unsafe source (warning only)
Every security gate follows the same pattern:
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
References
- github.com/advisories/GHSA-p3m8-78j2-g5p3
- github.com/nltk/nltk/commit/155e40343cff0bf50d233e274a12e04d1428b1d9
- github.com/nltk/nltk/pull/3593
- github.com/nltk/nltk/releases/tag/v3.10.0
- github.com/nltk/nltk/security/advisories/GHSA-p3m8-78j2-g5p3
- github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3722.yaml
- nvd.nist.gov/vuln/detail/CVE-2026-62388
- www.vulncheck.com/advisories/nltk-before-insecure-default-configuration-pathsec
Code Behaviors & Features
Detect and mitigate CVE-2026-62388 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →