Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-79674

CVE-2026-79674: NLTK Path Traversal Vulnerability

CVE-2026-79674 is a path traversal flaw in NLTK that allows attackers to bypass sandbox protections and read files outside intended directories. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-79674 Overview

CVE-2026-79674 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) affecting versions before 3.10.3. The flaw exists in the LinThesaurusCorpusReader and PanLexLiteCorpusReader corpus-reader constructors, which fail to enforce the pathsec sandbox boundary. Attackers can supply arbitrary corpus root paths to these constructors and read files outside the intended data root, including arbitrary filesystem content and SQLite databases. The weakness is classified as CWE-73: External Control of File Name or Path.

Critical Impact

Attackers who control corpus root arguments can read confidential files and SQLite databases anywhere the NLTK process has read access, breaking the pathsec sandbox that isolates untrusted corpus paths.

Affected Products

  • NLTK versions before 3.10.3
  • Applications embedding LinThesaurusCorpusReader
  • Applications embedding PanLexLiteCorpusReader

Discovery Timeline

  • 2026-08-25 - CVE-2026-79674 published to NVD
  • 2026-08-25 - Last updated in NVD database

Technical Details for CVE-2026-79674

Vulnerability Analysis

NLTK ships a path sandbox called pathsec that constrains corpus readers to a designated data root. The LinThesaurusCorpusReader and PanLexLiteCorpusReader constructors accept a corpus root path but do not validate that the supplied path resolves inside the sandbox boundary. An attacker who influences the constructor argument can point the reader at any location the Python process can access.

The vulnerability affects confidentiality directly. PanLexLiteCorpusReader opens SQLite databases, so attackers can read structured application data outside the intended directory. LinThesaurusCorpusReader reads thesaurus files, allowing exfiltration of arbitrary text content. The issue matters most in multi-tenant services, notebook platforms, or web backends that pass user-influenced paths into NLTK.

Root Cause

The root cause is missing path canonicalization and boundary checks against the pathsec root in the affected constructors. The readers trust the caller-supplied root instead of resolving it and verifying containment within the approved data directory. This is a classic external-control-of-file-path weakness ([CWE-73]).

Attack Vector

Exploitation requires an attacker to control or influence the corpus root argument passed to a vulnerable constructor. In web applications and API services, this typically means a request parameter, uploaded configuration, or user-selected dataset name reaches NLTK without sanitization. No authentication is required when the surrounding application accepts unauthenticated input. The attacker supplies a path outside the pathsec root, and NLTK reads the target file or SQLite database and returns parsed content through the application. Refer to the GitHub Security Advisory GHSA-3gq4-3j92-5w49 and the VulnCheck Path Traversal Advisory for additional technical detail.

// No verified proof-of-concept code is published for this CVE.
// See the linked advisories for reproduction details.

Detection Methods for CVE-2026-79674

Indicators of Compromise

  • Unexpected read access by Python processes to files outside declared NLTK data directories such as /etc/passwd, application configuration files, or SQLite databases owned by other tenants.
  • Application logs showing corpus reader instantiation with paths containing .., absolute paths outside the data root, or symlink targets.
  • Anomalous SQLite file opens by the Python interpreter hosting NLTK workloads.

Detection Strategies

  • Inventory Python dependencies and flag any NLTK version below 3.10.3 using software composition analysis.
  • Perform static code review for direct calls to LinThesaurusCorpusReader(...) and PanLexLiteCorpusReader(...) where the root argument originates from untrusted input.
  • Instrument runtime file access on hosts running NLTK to alert on reads outside the approved corpus directory.

Monitoring Recommendations

  • Enable process-level file access telemetry on servers running NLTK-based services and correlate open() calls against an allow-listed data root.
  • Alert on Python processes opening SQLite databases outside expected application paths.
  • Log all HTTP request parameters that flow into NLTK corpus readers to support post-incident review.

How to Mitigate CVE-2026-79674

Immediate Actions Required

  • Upgrade NLTK to version 3.10.3 or later across all environments, including containers, notebooks, and CI runners.
  • Audit application code for user-controlled paths passed to LinThesaurusCorpusReader or PanLexLiteCorpusReader and remove untrusted input from constructor arguments.
  • Restrict the filesystem permissions of the account running NLTK to the minimum required data directory.

Patch Information

The NLTK maintainers addressed the issue in version 3.10.3. The fix enforces the pathsec sandbox boundary inside the affected corpus reader constructors. Details are documented in GitHub Security Advisory GHSA-3gq4-3j92-5w49.

Workarounds

  • Hardcode corpus root paths in application code and reject any caller-supplied path values until upgrade is complete.
  • Run NLTK workloads inside a container or chroot whose only mounted filesystem is the intended corpus directory.
  • Apply mandatory access control (AppArmor, SELinux) to confine the Python process to the NLTK data directory.
bash
# Upgrade NLTK to the patched release
pip install --upgrade 'nltk>=3.10.3'

# Verify installed version
python -c "import nltk; print(nltk.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.