/

CVE-2026-82635

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Pake Desktop Application

CVE-2026-82635

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and User-Account 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

Pake's download_file Tauri command can combine a JavaScript-supplied filename with the user's Downloads directory without sanitizing path components. A script that can invoke the command may cause attacker-controlled content to be written outside that directory, potentially enabling user-account code execution through startup or login persistence locations.

Affected context

The vulnerability occurs in desktop applications generated from an affected Pake codebase when the download_file command accepts filename and URL values from JavaScript. The risk exists when an untrusted script can invoke the command and the supplied filename is interpreted as a relative traversal path or absolute filesystem path. The command performs the download through Rust and writes the returned content to the resolved destination, so browser-origin restrictions do not necessarily protect the filesystem operation.

Exploit preconditions

  • Attack surface: The Tauri command bridge exposed by a Pake-generated desktop application
  • Required access: Ability to execute or influence JavaScript that can invoke download_file
  • Trigger point: Filename resolution and file creation after the requested URL is fetched
  • Why exploitation is possible: The filename is joined to the Downloads directory without canonicalization, containment checks, or rejection of absolute paths
  • Content requirement: The attacker must be able to control or influence the downloaded URL or its returned content

Why this happens

The underlying bug is a failure to treat a JavaScript-provided filename as untrusted filesystem input. Joining an attacker-controlled path with an intended base directory does not guarantee that the resulting path remains beneath that directory; traversal components and absolute paths can escape the base location. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The unrestricted write operation is especially dangerous because user-writable startup and autostart locations can cause subsequently launched content to execute with the user's privileges.

Potential impact

  • Arbitrary files in user-writable locations may be overwritten
  • Malicious content may be placed in macOS LaunchAgents, Linux autostart, or Windows Startup locations
  • Code may execute in the affected user's account after login or application startup
  • User data or application configuration may be corrupted
  • Persistence may be established within the desktop environment
  • Other Pake-generated applications sharing the affected command pattern may expose the same risk

General mitigation guidance

Mitigation generally focuses on enforcing a strict destination boundary and minimizing the command's filesystem authority.

Common defensive patterns include:

  • Accepting only a generated basename or tightly constrained filename rather than arbitrary path text
  • Rejecting absolute paths, traversal segments, encoded traversal forms, and platform-specific alternate path syntax
  • Canonicalizing the candidate path and verifying that it remains within the intended Downloads directory
  • Using safe file-creation APIs that do not follow unexpected links or replace unrelated files
  • Separating download retrieval from filesystem placement and applying an explicit allowlist of permitted destinations
  • Restricting Tauri command exposure and validating all JavaScript-originated arguments at the native boundary
  • Applying least-privilege filesystem permissions and avoiding write access to startup or autostart locations
  • Requiring user-visible consent for downloads and treating downloaded files as untrusted content

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for filesystem joins involving request, JavaScript, or IPC-controlled path values
  • Code review checks for missing canonicalization, containment validation, and absolute-path rejection
  • Tests using traversal sequences, encoded separators, symlink scenarios, and platform-specific path formats
  • Tauri capability and permission reviews that inventory commands able to write files
  • Runtime monitoring for unexpected writes outside designated download directories
  • Endpoint policy alerts for new or modified startup, autostart, and login-agent files

Automated code review and security scanning tools may help flag dangerous path construction patterns, but their findings should be validated against platform-specific filesystem behavior.

Sources

SourceLink
github.comgithub.com/tw93/Pake
github.comgithub.com/tw93/Pake/commit/a5463a84d6e36705ee0dd1886cf0e4b5a75b0ab4
github.comgithub.com/tw93/Pake/releases/tag/V3.13.1

Frequently asked

questions

It is primarily dependent on application-level access rather than a direct network request to the operating system. A malicious or compromised script that can invoke the exposed Tauri command may be able to trigger the file write, while the command itself retrieves content from a supplied URL.

The attacker generally needs a way to execute or influence JavaScript within the affected desktop application and invoke download_file. The exact scope depends on the application's content loading, command permissions, and trust boundaries.

Treat the filename as untrusted, permit only a safe basename or controlled identifier, resolve it beneath a fixed directory, and verify the final canonical path before writing. The native command should independently enforce these checks rather than relying on browser-side validation.

Keep native filesystem commands narrowly scoped, apply least-privilege permissions, test path handling across operating systems, and monitor or restrict writes to persistence-related directories.

Find out what's already
exploitable in your codebase.