/

CVE-2026-79674

Severity:

HIGH RISK

(8.2)

Path Sandbox Bypass (CWE-73) in NLTK Corpus Readers

CVE-2026-79674

Analyzed

Vulnerability type

Category:

Path Sandbox Bypass

CWE:

CWE-73

Impact:

Arbitrary File Read and Sensitive Data Disclosure

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path sandbox bypass in NLTK corpus-reader constructors allows attacker-controlled corpus root paths to escape the intended data directory. When untrusted paths reach the affected readers, attackers may read arbitrary filesystem content, including SQLite database files accessible to the process.

Affected context

The vulnerability occurs in NLTK deployments that use the affected corpus readers and allow corpus root paths to be influenced by untrusted input or externally controlled configuration. Risk depends on the permissions of the NLTK process and whether the selected paths are accessible outside the intended corpus data root.

Exploit preconditions

  • Attack surface: Applications or services that invoke LinThesaurusCorpusReader or PanLexLiteCorpusReader
  • Required access: Ability to supply or influence a corpus root path
  • Trigger point: Construction or use of an affected corpus reader
  • Why exploitation is possible: Path validation does not reliably contain attacker-selected locations within the intended sandbox boundary

Why this happens

The underlying bug is improper control of externally influenced file paths. A corpus-reader constructor accepts a root path and uses it to locate files without enforcing a robust containment relationship with the approved data directory. This maps to CWE-73: External Control of File Name or Path, because input-controlled path values can direct filesystem operations outside their intended scope.

Potential impact

  • Attackers may read sensitive application files
  • Credentials, configuration data, or secrets may be disclosed
  • SQLite databases outside the corpus directory could be accessed
  • Information gathered from readable files could support further compromise
  • Data confidentiality may be reduced for the affected host or container

General mitigation guidance

Mitigation generally focuses on reducing trust in path inputs and enforcing filesystem boundaries before any file operation occurs.

Common defensive patterns include:

  • Accepting corpus locations only from trusted, fixed configuration
  • Using an allowlist of permitted corpus directories or resources
  • Canonicalizing paths and verifying that resolved paths remain under the approved root
  • Rejecting absolute paths, traversal components, and unexpected path schemes where appropriate
  • Applying strict schema and type validation before constructing corpus readers
  • Running the application with least-privilege filesystem permissions
  • Isolating corpus data and sensitive databases from the process when they are not required

How teams detect issues like this

Organizations can identify similar risks through:

  • Static analysis rules for filesystem APIs receiving constructor arguments or request-derived paths
  • Code review checks for missing canonicalization and root-containment validation
  • Tests using absolute paths, traversal-like components, symlinks, and alternate path representations
  • Runtime policies that restrict process access to approved data directories
  • File-access monitoring for unexpected reads outside designated corpus roots
  • Automated security review tools that flag externally controlled path construction

Sources

SourceLink
github.comgithub.com/nltk/nltk/security/advisories/GHSA-3gq4-3j92-5w49
vulncheck.comvulncheck.com/advisories/nltk-path-traversal-via-corpus-reader-constructors

Frequently asked

questions

It can be remotely exploitable when a network-facing application passes attacker-controlled values into the affected corpus-reader constructors. In local or tightly controlled deployments, exploitation may instead require access to configuration or execution inputs.

The attacker must be able to influence the corpus root path, directly or indirectly. The resulting impact also depends on which files the NLTK process can read.

Treat corpus paths as trusted configuration, enforce canonical path containment under an approved root, and reject paths that do not satisfy the policy before opening files.

Use allowlisted resource locations, apply least-privilege filesystem permissions, test path-boundary edge cases, and monitor file access outside approved data directories.

Find out what's already
exploitable in your codebase.