/

CVE-2026-42605

Severity:

HIGH RISK

(8.8)

Path Traversal in AzuraCast Media Upload Endpoint

CVE-2026-42605

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Authenticated Remote Code Execution via Arbitrary File Write

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 weakness in AzuraCast's Flow.js media upload endpoint allows authenticated users with media management permissions to write files outside the intended station media directory.

When a local filesystem backend is used, this can be abused to place arbitrary files such as PHP scripts into the web root, potentially leading to remote code execution.

Affected context

The vulnerability appears in AzuraCast instances using the Flow.js media upload API at POST /api/station/{station_id}/files/upload with a local filesystem storage backend.

It affects scenarios where the currentDirectory request parameter is accepted and used to build filesystem paths without fully neutralizing path traversal sequences such as ../.

Only users who are authenticated and have media management permissions for a station can reach and exercise this endpoint under normal configurations.

Exploit preconditions

  • Attack surface: HTTP API endpoint POST /api/station/{station_id}/files/upload
  • Required access: Valid authenticated user account with media management permissions for a target station
  • Environmental dependencies:
  • Station configured with a local filesystem storage backend (default mode)
  • Web server executing server-side code (e.g., PHP) from a directory reachable via filesystem traversal from the station media root
  • Trigger point: Supplying a crafted currentDirectory parameter containing path traversal sequences so that the uploaded file is written outside the station's media directory
  • Why exploitation is possible: The server-side handler trusts and concatenates currentDirectory with base paths without robust normalization or restriction, allowing attackers to break out of the intended storage directory and target sensitive locations such as the web root.

Why this happens

This issue stems from insufficient validation and normalization of user-controlled path components when constructing filesystem paths for uploaded media.

The currentDirectory parameter is used to determine where an uploaded file should be stored, but it is not properly sanitized to remove or reject traversal sequences like ../, absolute paths, or other bypass patterns.

As a result, the application logic violates the intended directory confinement and allows writing files outside the station media storage root.

Conceptually, this maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where user input is naively combined with filesystem paths, enabling attackers to reach arbitrary locations on the server's filesystem.

Potential impact

  • An authenticated attacker may write arbitrary files to directories outside the station's media storage area.
  • Attackers could place a PHP webshell or other executable script into the web root, enabling remote code execution under the web server's privileges.
  • Modification or overwriting of application files, configuration files, or other sensitive assets may occur if file permissions allow it.
  • Potential escalation from a limited media-management account to broader system compromise, including data theft or service disruption.

General mitigation guidance

Effective mitigation focuses on constraining file operations to well-defined directories and minimizing trust in client-controlled paths:

  • Enforce strict canonicalization of any directory parameters by resolving to an absolute path and verifying that it remains within a predefined base directory; reject requests that resolve outside this root.
  • Treat all user-supplied path segments, including directory names, as untrusted and restrict them to a whitelist of allowed characters and structures (e.g., no .., no leading slashes).
  • Centralize file storage APIs so all file writes pass through a safe abstraction that enforces directory confinement and path normalization.
  • Run the application and web server with minimal filesystem privileges, ensuring they cannot write to code directories or other sensitive locations wherever possible.
  • Consider using storage backends or deployment models where uploaded files cannot be interpreted as executable code (e.g., segregated file servers, object storage, or separate domains for static content).

How teams detect issues like this

Organizations can identify and monitor for this class of vulnerability using a combination of proactive and reactive techniques:

  • Static analysis and code scanning: Create rules that flag direct concatenation of user input into filesystem paths, especially parameters like directory, path, or filename, and require explicit normalization and boundary checks.
  • Code review practices: During reviews, scrutinize upload endpoints and file handling routines for assumptions about trusted paths; ensure reviewers look for ../ handling, canonical path checks, and enforced base directories.
  • Runtime logging and monitoring: Log upload destinations, including resolved absolute paths, and alert on attempts to write outside expected directories or into unusual locations such as application code paths.
  • Security testing and fuzzing: Incorporate path traversal payloads into API security tests for upload and file management endpoints to detect breakout behaviors before deployment.

Sources

SourceLink
github.comgithub.com/AzuraCast/AzuraCast/commit/18c793b4427eb49e67a2fea99a89f1c9d9dd808d
github.comgithub.com/AzuraCast/AzuraCast/releases/tag/0.23.6
github.comgithub.com/AzuraCast/AzuraCast/security/advisories/GHSA-vp2f-cqqp-478j

Frequently asked

questions

Yes, but only for authenticated users who have media management permissions. There is no anonymous attack path described; an attacker must first obtain valid credentials with sufficient privileges.

The attacker needs a legitimate AzuraCast account with media management rights for a station. With that access, they can call the Flow.js media upload endpoint and provide crafted currentDirectory values to manipulate where files are written.

The safest approach is to normalize any user-supplied path components to an absolute path and enforce that the final path remains within a predefined base directory. All file writes should go through a constrained storage layer that rejects requests attempting to traverse outside allowed roots, combined with input validation that disallows .. and other traversal patterns.

Treat all file and directory parameters as untrusted, implement a standard path-handling utility that enforces directory confinement, and make its use mandatory across the codebase. Augment this with secure coding guidelines, automated checks for path concatenation, and least-privilege deployment practices so that even if a path traversal slips through, it cannot lead to code execution or sensitive file modification.

Find out what's already
exploitable in your codebase.