/

CVE-2026-26975

Severity:

HIGH RISK

(8.8)

Path Traversal and Arbitrary File Write in Music Assistant

CVE-2026-26975

Analyzed

Vulnerability type

Category:

Path Traversal and Arbitrary File Write

CWE:

CWE-22, CWE-73, CWE-434

Impact:

Remote 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

Music Assistant versions 2.6.3 and below contain an arbitrary file write flaw in the music/playlists/update API that lets network-adjacent, unauthenticated attackers bypass .m3u extension checks and write files anywhere on the container filesystem.

By placing a crafted .pth file into Python's site-packages directory, an attacker can achieve remote code execution when Python loads the malicious file.

Affected context

This vulnerability affects Music Assistant deployments up to and including 2.6.3, particularly when:

  • The application is exposed on a network where untrusted clients can reach the music/playlists/update API
  • The container or host process runs with elevated privileges (e.g., as root), giving broad filesystem write access
  • Python's standard site-packages directory is writable by the Music Assistant process

In these contexts, playlist updates supplied over the network can be turned into arbitrary file writes beyond the expected playlist directory.

Exploit preconditions

  • Attack surface: HTTP endpoint music/playlists/update accessible over the local network or other adjacent network segments
  • Required access: No authentication required; attacker must be able to send crafted requests to the API
  • Trigger point: Server-side handling of playlist update operations that construct and write playlist files
  • Why exploitation is possible:
  • Insufficient validation of file paths and locations (CWE-22: Path Traversal)
  • Insecure handling of file creation/modification based on client-controlled input (CWE-73: External Control of File Name or Path)
  • Inadequate enforcement of output location and allowed file types, enabling the write of executable .pth files (CWE-434: Unrestricted File Upload / File Type Issues)

Why this happens

The root cause lies in trusting user-controlled data to determine where and how files are written on disk.

The music/playlists/update API accepts playlist information and constructs filesystem paths without adequately constraining them to a safe directory or strictly enforcing the expected .m3u extension.

This aligns with CWE-22 (Path Traversal) and CWE-73 (External Control of File Name or Path), where an external actor can influence filesystem targets, and CWE-434 (Unrestricted File Upload), where uploaded or generated files are not limited to non-executable formats.

Because the service runs as root in many containerized deployments, the process can write into sensitive directories such as Python's site-packages, where .pth files are automatically interpreted at interpreter startup, turning a file write bug into reliable code execution.

Potential impact

  • Remote execution of arbitrary commands within the Music Assistant container
  • Full compromise of the Music Assistant application and its data
  • Lateral movement to other services or infrastructure reachable from the compromised container
  • Persistent backdoor installation via malicious files in Python's runtime environment
  • Modification or deletion of arbitrary files on the container filesystem, possibly impacting other co-located services

General mitigation guidance

Mitigation for this bug class focuses on restricting filesystem influence from user input and reducing the impact of a compromise:

  • Constrain playlist and other user-generated files to a dedicated, non-sensitive directory with strict path normalization and rejection of any traversal sequences or absolute paths.
  • Enforce a strict allowlist of file extensions and disallow the creation of any files outside of expected, non-executable formats.
  • Use the principle of least privilege for the runtime: avoid running the container as root, and ensure the application user cannot write into interpreter or system directories.
  • Separate storage for content and code so that user-controlled paths can never overlap with locations that influence interpreter startup or executable search paths.
  • Introduce centralized helpers or APIs for safe file handling, encapsulating validation logic rather than constructing paths ad hoc throughout the codebase.

How teams detect issues like this

Detection typically involves both code-centric and operational approaches:

  • Static analysis rules that flag:
  • Direct concatenation of user-controlled values into filesystem paths
  • Use of relative path segments such as ../ derived from request parameters
  • Writes to generic or high-privilege directories (e.g., Python site-packages, system paths) based on non-constant input
  • Manual code review checklists that require:
  • Verifying that all user-influenced file paths are normalized and validated against an allowlist of directories and extensions
  • Confirming that upload or generated content paths cannot reach executable or configuration directories
  • Runtime monitoring for:
  • Unexpected creation of .pth or other executable-related files during playlist operations
  • File integrity checks on interpreter and library directories to detect unauthorized modifications
  • Integration of automated security scanning into CI/CD to catch path traversal and arbitrary file write patterns before deployment.

Sources

SourceLink
github.comgithub.com/music-assistant/server/pull/2684
github.comgithub.com/music-assistant/server/releases/tag/2.7.0
github.comgithub.com/music-assistant/server/security/advisories/GHSA-7jcc-p6xr-835j

Frequently asked

questions

It is exploitable by network-adjacent attackers who can reach the music/playlists/update API. Whether this includes the public internet depends on how the service is exposed and what network restrictions are in place.

No. The affected versions allow unauthenticated use of the vulnerable playlist update API, so simply being able to send crafted HTTP requests is sufficient.

The safest approach is to strictly confine all playlist and user-generated files to a dedicated directory, validate and normalize requested paths against this root, enforce a tight allowlist of non-executable file types, and ensure the service cannot write into interpreter or system directories.

Adopt standardized file-handling abstractions that perform rigorous path and extension validation, run services with least privilege, keep code and data directories strictly separated, and include checks for path traversal and arbitrary file write patterns in code reviews and automated security scans.

Find out what's already
exploitable in your codebase.