{"id":"CVE-2026-62388","aliases":["GHSA-p3m8-78j2-g5p3","PYSEC-2026-3722"],"url":"https://o3.security/vulnerability/CVE-2026-62388","summary":"NLTK before 3.10.0 Insecure Default Configuration in pathsec.py","details":"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.\n\nThe 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:\n\n1. pathsec.open('/etc/passwd') succeeds (reads the file, emits warning)\n2. pathsec.validate_network_url('http://169.254.169.254/...') succeeds (warning only)\n3. pickle.loads() via nltk.data.load() proceeds despite unsafe source (warning only)\n\nEvery security gate follows the same pattern:\n```python\nENFORCE = os.environ.get('NLTK_PATHSEC_ENFORCE', '').lower() in ('1', 'true', 'yes')\n\ndef validate_something(path):\n    if is_violation(path):\n        if ENFORCE:\n            raise SecurityError('...')  # Only raised when env var is set\n        else:\n            warnings.warn('...', RuntimeWarning)  # Default: warning only\n    # Execution continues regardless\n```\n\nThis 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.\n\nPoC:\n```python\nimport nltk.pathsec\nimport warnings\n\n# Show that ENFORCE is False by default\nprint(f'ENFORCE = {nltk.pathsec.ENFORCE}')  # False\n\n# Attempt to read /etc/passwd through pathsec -- should be blocked\nwith warnings.catch_warnings(record=True) as w:\n    warnings.simplefilter('always')\n    result = nltk.pathsec.open('/etc/passwd', 'r')\n    print(f'File opened: {result.name}')  # /etc/passwd\n    print(f'Warning emitted: {w[0].message}')  # RuntimeWarning (not an exception)\n    # Attack succeeds -- file is readable\n```\n\nThe 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.\n\nSuggested fix: Change default to ENFORCE=True. Users who need backwards compatibility can set NLTK_PATHSEC_ENFORCE=0 to explicitly disable.","published":"2026-08-22T14:12:38.647Z","modified":"2026-10-28T02:30:59.088244022Z","cvss":null,"epss":{"score":0.00512,"percentile":0.44544,"asOf":"2026-11-21"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"nltk","fixedVersion":"3.10.0"}],"fix":{"url":"https://github.com/nltk/nltk/pull/3593","label":"nltk/nltk#3593"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/62xxx/CVE-2026-62388.json"},{"type":"ADVISORY","url":"https://github.com/nltk/nltk/security/advisories/GHSA-p3m8-78j2-g5p3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62388"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/nltk-before-insecure-default-configuration-pathsec"},{"type":"WEB","url":"https://github.com/nltk/nltk/pull/3593"},{"type":"WEB","url":"https://github.com/nltk/nltk/commit/155e40343cff0bf50d233e274a12e04d1428b1d9"},{"type":"PACKAGE","url":"https://github.com/nltk/nltk"},{"type":"WEB","url":"https://github.com/nltk/nltk/releases/tag/v3.10.0"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3722.yaml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:59.088244022Z"}}