/

CVE-2026-91771

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Weights & Biases wandb

CVE-2026-91771

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(8.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

A path traversal vulnerability in the wandb File.download function allows filenames received from a backend response to escape the intended download directory. If an attacker can control the backend response, they may overwrite files in accessible locations, potentially enabling code execution through shell startup files or Python import paths.

Affected context

The vulnerability occurs in wandb deployments that use the affected File.download functionality and trust filenames supplied by server responses. Risk increases when a backend or intermediary can influence those responses and the client process has write access to sensitive filesystem locations.

Exploit preconditions

  • Attack surface: File download handling in the wandb client
  • Required access: Ability to control, compromise, or influence the backend response supplying the filename
  • Trigger point: Processing a downloaded file and constructing its local destination path
  • Why exploitation is possible: The filename is not sufficiently validated or constrained to the intended download directory, allowing traversal components to redirect the write operation

Why this happens

The underlying bug is an improper limitation of a pathname used for file output. The File.download function accepts a server-provided filename without reliably canonicalizing it and verifying that the resulting path remains within the designated download directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal.

Potential impact

  • An attacker may overwrite files reachable by the wandb client process.
  • The vulnerability could enable modification of shell startup files or Python import paths.
  • Successful file modification may lead to code execution under the client process identity.
  • Attackers may cause data loss, configuration tampering, or persistence.
  • A compromised client could expose credentials, project data, or connected environments.

General mitigation guidance

Mitigation generally focuses on treating server-provided filenames as untrusted data and enforcing a strict destination boundary.

Common defensive patterns include:

  • Canonicalizing candidate paths before writing and verifying they remain under the intended directory.
  • Rejecting absolute paths, traversal components, and platform-specific alternate path forms.
  • Deriving local filenames from trusted identifiers rather than accepting arbitrary remote names.
  • Using dedicated, least-privileged download directories with restrictive permissions.
  • Preventing downloaded content from being placed in executable, startup, or import-search locations.
  • Applying filesystem isolation and avoiding write access to sensitive user or system files.

How teams detect issues like this

Organizations can look for path-handling risks through:

  • Static analysis rules that flag path construction from network-controlled strings.
  • Code review checks for missing canonicalization and destination-boundary validation.
  • Tests covering absolute paths, traversal markers, encoded separators, and platform-specific path behavior.
  • Runtime monitoring for client processes writing outside approved download directories.
  • Policy enforcement requiring untrusted filenames to pass an approved path-validation utility.

Automated code review and software composition analysis tools may help identify related patterns.

Sources

SourceLink
github.comgithub.com/wandb/wandb
github.comgithub.com/wandb/wandb/blob/v0.27.2/wandb/apis/public/files.py#L319-L347
github.comgithub.com/wandb/wandb/commit/e52558f3a6a94ea816af74969a13a35e5904cad6
github.comgithub.com/wandb/wandb/issues/12592
github.comgithub.com/wandb/wandb/releases/tag/v0.29.0
vulncheck.comvulncheck.com/advisories/weights-biases-wandb-before-0.29.0-path-traversal-via-file-download

Frequently asked

questions

Exploitation can be remotely initiated when an attacker controls or compromises the backend response consumed by the wandb client. The client must then process the malicious filename.

The attacker generally needs influence over the backend or communication path that supplies download metadata. The impact also depends on the local permissions of the client process.

Treat remote filenames as untrusted, canonicalize the resulting path, and verify that it remains within a dedicated download directory before writing.

Use trusted filename derivation, enforce strict path-boundary checks, test platform-specific path formats, and run download workflows with least-privilege filesystem access.

Find out what's already
exploitable in your codebase.