# NLTK insecure default configuration in pathsec

Source: https://junglewise.ai/threats/nltk-insecure-default-configuration-in-pathsec-f4930423  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-22. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: high · CVSS 7.5 · Published 2026-08-22

NLTK is a popular Python library for natural language processing that includes a pathsec security module designed to prevent arbitrary code execution and unauthorized file access. Due to an insecure default configuration, these security protections are disabled by default and only emit warnings rather than blocking dangerous operations. Attackers can exploit this to read sensitive files or execute arbitrary code via pickle deserialization without setting an environment variable that most users are unaware of.

Technologies: [nltk (PyPI)](https://junglewise.ai/threats/technologies/nltk). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 7.5, published 22 August 2026.

**Which products and versions are affected?** nltk (PyPI) <= 3.9.4.

**Is there a fix for This vulnerability?** A patch was published on 2026-08-22: Fix available in NLTK 3.10.0 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run nltk (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is an insecure default configuration (CWE-1188) in NLTK's pathsec.py module. The ENFORCE flag defaults to False, causing eight security validation functions to emit RuntimeWarning instead of raising exceptions when violations are detected. The pathsec module was designed to remediate CVE-2024-39705 (pickle arbitrary code execution) and CVE-2026-0846 (path traversal), but with ENFORCE=False as the default, these protections are opt-in rather than opt-out. An unauthenticated attacker can read arbitrary files via pathsec.open() or bypass pickle deserialization safety checks via nltk.data.load() with untrusted sources—the module succeeds and only emits a warning. The security controls require manual activation by setting the NLTK_PATHSEC_ENFORCE environment variable to '1', 'true', or 'yes'. The fix is available in NLTK 3.10.0, which changes the default to ENFORCE=True.

## Affected products

- NLTK Project NLTK <= 3.9.4

## Timeline

- 2026-08-07: disclosed: Original advisory published
- 2026-08-22: advisory: Published to GitHub Advisory Database and NVD as CVE-2026-62388
- 2026-08-22: patched: Fix available in NLTK 3.10.0

## References

- [https://github.com/nltk/nltk/security/advisories/GHSA-p3m8-78j2-g5p3](https://github.com/nltk/nltk/security/advisories/GHSA-p3m8-78j2-g5p3)
- [https://www.vulncheck.com/advisories/nltk-before-insecure-default-configuration-pathsec](https://www.vulncheck.com/advisories/nltk-before-insecure-default-configuration-pathsec)

## Related threats

- [NLTK WekaClassifier path traversal in model validation](https://junglewise.ai/threats/cve-2026-109956-nltk-through-3-10-3-contains-a-path-traversal-vulnerability-in)
- [NLTK RecursiveDescentParser uncontrolled recursion denial of service](https://junglewise.ai/threats/cve-2026-12876-nltk-recursivedescentparser-uncontrolled-recursion-denial-of)
- [NLTK tgrep regular expression denial of service](https://junglewise.ai/threats/nltk-tgrep-regular-expression-denial-of-service-02fca1b2)
- [NLTK Downloader hardlink filesystem containment bypass](https://junglewise.ai/threats/nltk-downloader-hardlink-filesystem-containment-bypass-522cb97d)
- [NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks](https://junglewise.ai/threats/nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks-8473e6ef)
