/

CVE-2026-62384

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in NLTK FramenetCorpusReader

CVE-2026-62384

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Information Disclosure

Severity:

HIGH RISK

(7.5)

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

NLTK versions before 3.10.2 contain a symlink-based path traversal weakness in FramenetCorpusReader. An attacker who can place crafted symlinks in the corpus subdirectory may cause the application to read XML files outside the intended corpus root.

Affected context

The vulnerability occurs in deployments using NLTK's FramenetCorpusReader with a corpus directory that an attacker can modify or influence. Symlink names containing no path separators may pass the reader's path validation, while filesystem resolution redirects access to XML files outside the approved corpus root through methods such as frame_by_name(), _lu_file(), or doc().

Exploit preconditions

  • Attack surface: Local filesystem access to an NLTK FrameNet corpus subdirectory
  • Required access: Permission to create or modify symlinks within that directory
  • Trigger point: Affected corpus-reader methods accessing a symlink-backed XML resource
  • Why exploitation is possible: Validation checks the apparent entry name without sufficiently enforcing the resolved target's containment within the corpus root

Why this happens

The underlying bug is an incomplete path containment check. The reader validates a user-controlled filename before fully resolving symbolic links, allowing a permitted-looking directory entry to reference a file elsewhere on the filesystem. This behavior maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory, because the effective target is not reliably constrained to the intended corpus directory.

Potential impact

  • An attacker may read arbitrary accessible XML files outside the corpus root.
  • Sensitive application or system information could be disclosed.
  • Retrieved data could be used to support further attacks or credential discovery.
  • Integrity and confidentiality of corpus-processing workflows could be weakened.

General mitigation guidance

Mitigation generally focuses on enforcing containment after filesystem resolution and reducing trust in corpus contents.

Common defensive patterns include:

  • Resolve candidate paths and verify that the canonical target remains beneath the approved corpus root.
  • Reject symbolic links or use file-opening mechanisms that prevent traversal through links where appropriate.
  • Treat corpus directories as trusted, immutable inputs and restrict who can create or replace entries.
  • Run corpus-processing workloads with least-privilege filesystem permissions.
  • Store sensitive files outside locations readable by the NLTK process.
  • Apply defense-in-depth controls such as isolated workers and read-only corpus mounts.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis and code review of path validation that occurs before symlink or canonical-path resolution.
  • Tests using symlinked files, nested directories, and boundary-prefix path names.
  • Runtime monitoring for unexpected file access outside approved corpus directories.
  • Filesystem integrity policies that alert on symlink creation or changes in corpus locations.
  • Automated security review tools configured to identify path traversal and unsafe file-handling patterns.

Sources

SourceLink
github.comgithub.com/nltk/nltk/security/advisories/GHSA-f833-7jw8-xwrv
vulncheck.comvulncheck.com/advisories/nltk-framenetcorpusreader-symlink-sandbox-bypass-before

Frequently asked

questions

Not by itself. Exploitation generally requires a separate ability to create or modify symlinks in the corpus directory, although that access may come from a remote service or shared processing workflow.

The attacker needs filesystem permissions or another trusted workflow that allows symlink placement inside the relevant corpus subdirectory.

Enforce canonical-path containment after resolving links, or reject symlinks entirely when processing corpus resources.

Use immutable and trusted input directories, test path handling with symlink edge cases, monitor filesystem changes, and run readers with minimal access to sensitive files.

Find out what's already
exploitable in your codebase.