Music Assistant Remote Code Execution Vulnerability
Vulnerability
A remote code execution vulnerability exists in Music Assistant versions through 2.6.3. The issue arises from improper validation of user-supplied file paths in the music/playlists/update API, allowing unauthenticated network-adjacent attackers to write files with malicious payloads anywhere on the filesystem. This vulnerability is particularly severe because the application runs as root, enabling the execution of arbitrary code by placing a malicious .pth file in the Python site-packages directory, where it is executed when Python is launched.
Impact
Exploitation of this vulnerability allows for arbitrary code execution on the affected system, with the executed code running as the root user.
Reproduction
To reproduce this vulnerability, first create a local file system provider that points to the root directory. Then, create a playlist using this provider. After the playlist is created, update its details to change the file path to a .pth file in the site-packages directory, without the proper extension. Finally, add a track to the playlist that includes Python code to download and execute a payload from an external server.
Remediation
Users can update to Music Assistant version 2.7.0, which addresses this vulnerability by adding proper authentication to the webserver and fixing the playlist update functionality to prevent arbitrary file writes.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
