/

CVE-2026-81726

Severity:

HIGH RISK

(7.0)

Path Traversal (CWE-73) in NLTK Model-Artifact APIs

CVE-2026-81726

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Unauthorized File Read and Write

Severity:

HIGH RISK

(7.0)

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 through version 3.10.3 contains a path traversal vulnerability in model-artifact APIs that can bypass pathsec enforcement when raw file operations use caller-controlled paths. An attacker who can influence these paths may read or write files outside the intended sandbox roots.

Affected context

The issue can occur in NLTK deployments that enable pathsec protections while using model-artifact APIs such as TransitionParser, AveragedPerceptron, PerceptronTagger, or maxent parameter handling. Risk is higher when application-controlled or externally influenced path values reach raw filesystem operations without being normalized and verified against the permitted root.

Exploit preconditions

  • Attack surface: NLTK model and parameter file APIs
  • Required access: Ability to supply or influence a file path consumed by an affected API
  • Trigger point: A model load, save, or parameter operation that performs filesystem access
  • Why exploitation is possible: Raw file operations may use caller-controlled paths without consistently applying pathsec root restrictions

Why this happens

The vulnerability results from inconsistent enforcement of filesystem path boundaries. A security control may define approved sandbox roots, but affected code paths can perform direct file operations using an attacker-influenced path before or without applying equivalent canonicalization and containment checks. This maps to CWE-73: External Control of File Name or Path, in which untrusted input influences filesystem locations.

Potential impact

  • An attacker may read sensitive files outside the intended model directory
  • An attacker could overwrite application configuration or model artifacts
  • Runtime behavior may be altered through unauthorized file modification
  • Credentials, tokens, or other local secrets could be exposed
  • Downstream applications may consume tampered model data

General mitigation guidance

Mitigation generally focuses on making filesystem boundaries consistent across every model-artifact operation.

Common defensive patterns include:

  • Resolving and canonicalizing paths before access
  • Enforcing containment within explicitly approved roots after resolution
  • Using secure-by-default APIs that accept trusted directory handles or validated artifact identifiers instead of arbitrary paths
  • Reducing input trust by treating model paths and parameters as untrusted at every boundary
  • Rejecting traversal components, unexpected path forms, and symbolic-link escapes where appropriate
  • Applying least-privilege filesystem permissions to the process and artifact directories
  • Separating writable artifact locations from sensitive application and credential paths

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying raw file operations fed by external, configuration-derived, or API-provided paths
  • Code review checks for missing canonicalization, root-containment validation, or symbolic-link handling
  • Tests that verify every model-artifact API rejects paths outside its permitted directory
  • Runtime monitoring for unexpected reads or writes outside approved model roots
  • Policy enforcement requiring centralized path-validation helpers for filesystem access
  • Automated security review tools that flag externally controlled filename and path flows

Sources

SourceLink
github.comgithub.com/nltk/nltk/security/advisories/GHSA-8mgp-746c-j5xp
vulncheck.comvulncheck.com/advisories/nltk-through-3.10.3-path-traversal-via-model-artifact-apis

Frequently asked

questions

Exploitability depends on whether an attacker can influence a path supplied to an affected NLTK API. Applications that expose model selection, artifact management, or related path values through a network-facing interface may provide a remote attack path.

The attacker generally needs a way to control or modify a path consumed by an affected model-artifact operation. The exact requirement depends on the surrounding application's authentication and input-validation controls.

Use centralized path validation that canonicalizes the requested location and verifies containment within an approved root before any filesystem operation. Prefer artifact identifiers or trusted directory abstractions over arbitrary caller-provided paths.

Treat all externally influenced paths as untrusted, test every file-access API for traversal and link-escape cases, enforce least-privilege filesystem permissions, and monitor access outside designated artifact directories.

Find out what's already
exploitable in your codebase.