{"schema":"threatline.record/2","record":{"id":"CVE-2026-62388","aliases":["GHSA-p3m8-78j2-g5p3","PYSEC-2026-3722"],"summary":"NLTK: Default ENFORCE=False Disables All pathsec Security Controls","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.","categories":["Libraries & packages"],"product":"nltk","vendor":"nltk","ecosystem":"pip","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-p3m8-78j2-g5p3","source_modified_at":"2026-10-27T07:57:48Z","fetched_at":"2026-10-27T10:24:27.527526Z","package":{"ecosystem":"pip","name":"nltk"},"range":"<= 3.9.4"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-62388","source_modified_at":"2026-08-29T11:47:32.048Z","fetched_at":"2026-10-27T10:24:27.527526Z","product":"nltk","vendor":"nltk","versions":[{"version":"0","status":"affected","versionType":"semver","lessThan":"3.10.0"},{"version":"3.10.0","status":"unaffected","versionType":"semver"}],"defaultStatus":"unaffected"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-p3m8-78j2-g5p3","source_modified_at":"2026-09-02T16:00:17.572328596Z","fetched_at":"2026-10-27T10:24:27.527526Z","package":{"name":"nltk","ecosystem":"PyPI","purl":"pkg:pypi/nltk"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.10.0"}]}],"versions":["0.8","0.9","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","2.0.1","2.0.1rc1","2.0.1rc2-git","2.0.1rc3","2.0.1rc4","2.0.2","2.0.3","2.0.4","2.0.5","2.0b4","2.0b5","2.0b6","2.0b7","2.0b8","2.0b9","3.0.0","3.0.0b1","3.0.0b2","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1","3.2","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.3","3.4","3.4.1","3.4.2","3.4.3","3.4.4","3.4.5","3.5","3.5b1","3.6","3.6.1"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-p3m8-78j2-g5p3","source_modified_at":"2026-10-27T07:57:48Z","fetched_at":"2026-10-27T10:24:27.527526Z","package":{"ecosystem":"pip","name":"nltk"},"version":"3.10.0"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-62388","source_modified_at":"2026-08-29T11:47:32.048Z","fetched_at":"2026-10-27T10:24:27.527526Z","package":{"name":"nltk","ecosystem":null},"version":"3.10.0","basis":"first unaffected version stated in the CVE record"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-p3m8-78j2-g5p3","source_modified_at":"2026-09-02T16:00:17.572328596Z","fetched_at":"2026-10-27T10:24:27.527526Z","package":{"name":"nltk","ecosystem":"PyPI","purl":"pkg:pypi/nltk"},"version":"3.10.0"}],"cvss":8.7,"severity":"High","kev":{"listed":false},"epss":{"probability":0.00512,"percentile":0.43426,"score_date":"2026-10-26"},"published_at":"2026-08-22T14:12:38.647Z","modified_at":"2026-10-27T07:57:48Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-p3m8-78j2-g5p3","fetched_at":"2026-10-27T10:24:27.527526Z","source_modified_at":"2026-10-27T07:57:48Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-62388","fetched_at":"2026-10-27T10:24:27.527526Z","source_modified_at":"2026-08-29T11:47:32.048Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-p3m8-78j2-g5p3","fetched_at":"2026-10-27T10:24:27.527526Z","source_modified_at":"2026-09-02T16:00:17.572328596Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-62388","fetched_at":"2026-10-27T10:24:27.527526Z","source_modified_at":"2026-10-26"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/nltk/nltk/security/advisories/GHSA-p3m8-78j2-g5p3","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62388","source":"GitHub Advisory Database"},{"url":"https://github.com/nltk/nltk/pull/3593","source":"GitHub Advisory Database"},{"url":"https://github.com/nltk/nltk/commit/155e40343cff0bf50d233e274a12e04d1428b1d9","source":"GitHub Advisory Database"},{"url":"https://github.com/nltk/nltk/releases/tag/v3.10.0","source":"GitHub Advisory Database"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3722.yaml","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://www.vulncheck.com/advisories/nltk-before-insecure-default-configuration-pathsec","tags":["third-party-advisory"]},{"url":"https://github.com/advisories/GHSA-p3m8-78j2-g5p3","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"yes","technical_impact":"partial","assessed_at":"2026-08-26T17:53:47.950536Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-27T07:57:48Z","content_hash":"7a0b369fbc0d6455e702f76342685173a2b2acc380748db424b5a0a405988859"}}
