/

CVE-2026-45225

Severity:

HIGH RISK

(7.6)

Path Traversal in Heym File Upload Endpoint

CVE-2026-45225

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File System Access

Severity:

HIGH RISK

(7.6)

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

Heym versions before 0.0.21 contain a path traversal vulnerability in the file upload endpoint, where crafted filenames with traversal sequences are insufficiently validated.

Authenticated users can abuse this flaw to write attacker-controlled files to arbitrary locations on the server, potentially enabling unauthorized file reads, overwrites, or deletions outside the intended storage directory.

Affected context

This vulnerability appears in deployments of Heym that expose the file upload endpoint to authenticated users and rely on a server-side directory for storing uploaded files.

The affected handler (upload_file()) accepts a filename parameter from the client and uses it directly or with inadequate normalization when constructing filesystem paths.

In environments where the application process has broad filesystem permissions, this can allow uploads to sensitive directories beyond the intended storage path.

Exploit preconditions

  • Attack surface: Authenticated HTTP interface providing file upload functionality.
  • Required access: Valid authenticated user account capable of invoking the file upload endpoint.
  • Trigger point: Submission of an upload request with a crafted filename containing directory traversal sequences (for example, sequences that move up the directory tree).
  • Why exploitation is possible: The server constructs destination file paths from user-supplied filename data without robust normalization, canonicalization, and validation, permitting traversal outside the designated upload directory.

Why this happens

The root cause is improper neutralization of special elements used in path traversal, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The upload handler trusts the user-supplied filename, combining it directly with the base upload directory or performing only superficial checks.

Without canonicalizing the path and enforcing a strict constraint that resulting paths remain within the intended directory, traversal elements (such as parent directory references) can redirect file operations to arbitrary locations on the server filesystem.

Potential impact

  • Attackers may write arbitrary files to locations outside the intended upload directory.
  • Attackers could overwrite existing application or configuration files accessible to the process.
  • Attackers may place web-accessible files that could be executed or served to other users, depending on server configuration.
  • Attackers could facilitate further compromise by planting scripts, modifying logs, or disrupting service through destructive overwrites.

General mitigation guidance

Effective mitigation focuses on strictly constraining file paths derived from user input and minimizing filesystem trust boundaries.

Common defensive patterns include:

  • Deriving server-side filenames independently from user-supplied names (e.g., generating identifiers) and storing the original name only as metadata.
  • Normalizing and canonicalizing any incoming path components, then explicitly verifying that the resolved path resides inside the intended upload directory before performing file operations.
  • Maintaining an allowlist of valid characters or patterns for filenames and rejecting or sanitizing inputs that include directory separators or traversal tokens.
  • Running the application under a dedicated account with minimal filesystem privileges and restricting write access to a tightly scoped upload directory.
  • Separating uploaded content from executable paths so that even if traversal occurs, files cannot be executed by the application server.

How teams detect issues like this

Detecting this class of issue typically involves layered review and analysis techniques:

  • Static analysis: Configure rules to flag uses of user-controlled data in filesystem APIs (e.g., open, write, unlink) where paths are built by concatenating base directories with request parameters or where normalization is absent.
  • Code review: Look for handlers that accept filenames or paths from clients, then verify that they enforce strict validation, canonicalization, and directory constraints before performing file I/O.
  • Runtime monitoring: Enable logging of file operations, including target paths and request context, to detect anomalous access patterns such as writes or reads outside expected directories.
  • Policy enforcement: Introduce secure coding guidelines or pre-commit hooks that forbid direct use of raw client-supplied paths and encourage centralized, reviewed utilities for path handling.

Sources

SourceLink
github.comgithub.com/heymrun/heym/commit/835843e6d2bf7d018cbb8e50f28f0426eaa20c84
github.comgithub.com/heymrun/heym/pull/92
github.comgithub.com/heymrun/heym/releases/tag/v0.0.21
vulncheck.comvulncheck.com/advisories/heym-path-traversal-file-upload-via-upload-file

Frequently asked

questions

Yes, but only by authenticated users who can access the file upload endpoint. They can exploit it remotely by sending crafted upload requests with malicious filenames.

The attacker must have a valid authenticated account with permission to invoke the upload_file() handler. No additional local system access is required beyond the application's exposed interface.

The safest pattern is to decouple server-side file paths from client input by generating internal filenames, strictly canonicalizing any path components, and enforcing that all resulting paths remain within a predefined upload directory before performing any file operation.

Establish reusable utilities for secure path handling, enforce validation and canonicalization of any path-like inputs, adopt principle-of-least-privilege for filesystem access, and integrate static analysis or code review checklists that explicitly cover path traversal risks in file handling code.

Find out what's already
exploitable in your codebase.