/

CVE-2026-59974

Severity:

HIGH RISK

(7.8)

Path Traversal (CWE-22) in Stanza Archive Extraction

CVE-2026-59974

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Overwrite and Potential Code Execution

Severity:

HIGH RISK

(7.8)

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

Stanza can extract downloaded model and resource archives without validating member paths, allowing archive entries to escape the intended destination directory. If an attacker can influence an archive processed by a Stanza installation, files writable by the Stanza process may be overwritten, potentially enabling code execution.

Affected context

The issue occurs in Stanza deployments that download or install model and resource archives through archive-extraction paths such as stanza.download or stanza.install_corenlp. Risk depends on whether an attacker can supply or influence a processed archive and whether the Stanza process has write access outside the intended model directory.

Exploit preconditions

  • Attack surface: Stanza archive download and installation workflows
  • Required access: Ability to influence, replace, or otherwise cause a malicious model or resource archive to be processed
  • Trigger point: Extraction of archive members into a configured destination directory
  • Why exploitation is possible: Archive member paths are not sufficiently constrained to the destination directory, allowing parent-directory traversal and writes to other process-writable locations

Why this happens

The vulnerability results from extracting archive members without canonicalizing and validating their paths before writing files. When archive entries contain parent-directory traversal components, the extraction routine may resolve them outside the intended directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal or archive traversal.

Potential impact

  • Files writable by the Stanza process may be overwritten
  • Shell configuration or SSH authorization data could be modified
  • Python packages or executable scripts could be replaced
  • An attacker may achieve code execution under the Stanza process account
  • Application integrity, model integrity, or host security could be compromised

General mitigation guidance

Mitigation generally focuses on enforcing archive extraction boundaries and reducing trust in downloaded content.

Common defensive patterns include:

  • Canonicalizing each archive member path before extraction
  • Rejecting absolute paths and paths that resolve outside the intended destination
  • Using archive APIs or wrappers that provide traversal-safe extraction
  • Applying strict integrity and authenticity checks to downloaded archives
  • Restricting write permissions for the Stanza process and its runtime directories
  • Running model installation workflows with least privilege and suitable filesystem isolation
  • Separating downloaded model data from shell, SSH, package, and executable paths

How teams detect issues like this

Organizations can identify archive traversal risks through:

  • Static analysis rules for direct use of archive extraction APIs without member-path validation
  • Code review checks for ZipFile.extractall and equivalent functions handling untrusted archives
  • Tests containing absolute paths and parent-directory traversal entries
  • Runtime monitoring for writes outside approved model and resource directories
  • File-integrity monitoring for changes to shell configuration, SSH authorization data, packages, and executable paths
  • Policy enforcement requiring authenticated archives and sandboxed extraction workflows

Automated code review and software composition analysis tools may help surface unsafe archive-handling patterns.

Sources

SourceLink
github.comgithub.com/stanfordnlp/stanza/commit/a7085e75abdf35f277754dda472bba4e6819bcbb
github.comgithub.com/stanfordnlp/stanza/releases/tag/v1.14.0
github.comgithub.com/stanfordnlp/stanza/security/advisories/GHSA-2fwf-f686-7p34

Frequently asked

questions

It is not necessarily exposed as a direct network service. Exploitation generally requires an attacker to influence an archive that a Stanza process later downloads or installs, or to control an upstream source used by that workflow.

The attacker needs a way to provide or substitute a malicious archive and must have the archive processed by a vulnerable extraction path. The resulting impact is limited by the files writable by the Stanza process.

Validate every archive member before extraction, reject paths that are absolute or escape the intended directory, and use authenticated inputs with least-privilege filesystem permissions.

Treat downloaded archives as untrusted, test extraction logic with traversal-focused cases, monitor writes outside approved directories, and isolate model installation from sensitive configuration and executable locations.

Find out what's already
exploitable in your codebase.