/

CVE-2026-53777

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Perry Artifact Handling

CVE-2026-53777

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Overwrite and Exposure

Severity:

HIGH RISK

(8.1)

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

Perry versions before 0.5.1159 contain a path traversal flaw in how artifact names and download paths from a build server are handled.

A malicious or compromised build server can supply crafted path components that cause the client to overwrite sensitive files or expose local files to attacker-controlled locations.

Affected context

This vulnerability appears in environments where Perry connects to a build server and processes ArtifactReady WebSocket messages.

It is relevant when the client trusts server-supplied artifact_name or download_path values and writes files to locations derived from these fields.

The issue is most impactful when the running process has write access to sensitive directories or when local files can be exposed through locations reachable by an attacker.

Exploit preconditions

  • Attack surface: WebSocket communication channel between Perry and the configured build server
  • Required access: Ability to control or spoof the build server endpoint or the ArtifactReady messages it emits
  • Trigger point: Handling of artifact_name or download_path fields when saving or exposing build artifacts on the client
  • Why exploitation is possible: Server-supplied path components are accepted without sufficient normalization, validation, or restriction to an intended base directory, enabling directory traversal sequences to influence the final file path

Why this happens

The underlying bug stems from insufficient validation of file system paths derived from untrusted input.

Perry uses the artifact_name and download_path fields from ArtifactReady WebSocket messages to construct file paths without robust normalization and enforcement of a confined directory.

This corresponds to CWE-22: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal), where user- or server-controlled path segments are allowed to escape the expected directory and target arbitrary locations.

Potential impact

  • Overwriting configuration files or application binaries the process can write
  • Planting or modifying scripts and data files used by other components
  • Exposing arbitrary local files by copying them into directories accessible to the attacker
  • Degrading system integrity or enabling follow-on attacks through tampered artifacts

General mitigation guidance

Effective mitigation focuses on constraining and sanitizing file system interactions derived from external inputs.

Helpful patterns include:

  • Resolving and normalizing paths, then enforcing that final paths remain under a designated base directory
  • Rejecting path components containing traversal sequences or absolute paths
  • Using whitelists of allowed filenames or directory structures for artifacts
  • Running the client with least-privilege file system permissions, limiting the impact of any file writes
  • Separating untrusted artifact storage from sensitive configuration or executable paths

How teams detect issues like this

Detection typically combines code-centric and operational approaches:

  • Static analysis rules that flag use of unsanitized external inputs in file path construction
  • Code review checklists that require explicit path normalization and base-directory enforcement for all artifact handling logic
  • Logging and monitoring for unexpected write operations outside intended artifact directories
  • Policy enforcement in CI/CD to prevent merging changes that introduce direct concatenation of untrusted path segments into file operations

Sources

SourceLink
github.comgithub.com/PerryTS/perry/commit/95e1043df8081f67038bffce847dd9ddb3dae046
github.comgithub.com/PerryTS/perry/pull/4989
github.comgithub.com/PerryTS/perry/releases/tag/v0.5.1159
github.comgithub.com/PerryTS/perry/security/advisories/GHSA-x55v-q459-68ch
vulncheck.comvulncheck.com/advisories/perry-path-traversal-via-artifactready-websocket

Frequently asked

questions

Yes, if an attacker can control the build server endpoint or intercept and modify ArtifactReady WebSocket messages, they can remotely influence where artifacts are written on the client system.

The attacker must be able to configure or impersonate the server URL that Perry connects to, or otherwise inject crafted artifact_name or download_path values into the WebSocket channel.

Constrain all file operations to a well-defined base directory, normalize resulting paths, and reject any path that resolves outside this boundary, while also disallowing absolute paths and traversal patterns.

Treat all externally supplied path components as untrusted, apply strict validation and normalization before use, enforce least privilege on file system permissions, and adopt secure coding guidelines for file and path handling in all components.

Find out what's already
exploitable in your codebase.