Summary
Music Assistant evaluates a caller-controlled type parameter when handling certain configuration and value lookup commands. Any authenticated user may be able to trigger arbitrary Python code execution with the server process's privileges, even if the request later fails validation.
Affected context
The vulnerability occurs in argument parsing for the config/core/get_value, config/providers/get_value, and config/players/get_value commands. Requests can reach these commands through the WebSocket /ws endpoint or REST JSON-RPC /api endpoint. The issue affects versions before 2.8.0, and a default installation does not require special configuration for the vulnerable behavior to be present.
Exploit preconditions
- Attack surface: WebSocket
/wsor REST JSON-RPC/apiendpoint - Required access: Authentication; the description indicates no particular user role is required
- Trigger point: Argument parsing for one of the affected get-value commands
- Why exploitation is possible: A caller-controlled
return_typeis passed to Pythoneval()before command-handler validation
Why this happens
The argument parser uses a dynamic evaluation mechanism to resolve a type parameter supplied by the caller. Evaluating externally controlled input as code can allow arbitrary expressions to execute, matching CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code. Because evaluation occurs before command-handler validation, later rejection of a request does not prevent the earlier execution.
Potential impact
- Arbitrary Python code may run with the Music Assistant server process's privileges.
- Attackers could expose secrets or configuration data.
- Library data could be altered.
- The application container could be controlled or further compromised.
General mitigation guidance
Mitigation generally focuses on removing dynamic evaluation of caller-controlled values and narrowing the input trust boundary.
Common defensive patterns include:
- Replacing
eval()with explicit type maps, allowlists, or other non-executable parsing. - Validating type parameters against a strict schema before they are used.
- Applying authorization checks and input validation before any parsing behavior with security impact.
- Limiting the server process's privileges and access to secrets and sensitive data.
- Restricting access to API endpoints to trusted users and networks where appropriate.
How teams detect issues like this
High-level detection approaches include:
- Static analysis rules and code review searches for
eval()or similar dynamic evaluation on request-derived values. - Reviewing argument-parsing paths to confirm validation and authorization happen before sensitive processing.
- Enforcing policies that prohibit evaluating untrusted input and require allowlisted type resolution.
- Monitoring API and WebSocket activity for unexpected access to affected commands.
Automated code review tools can help identify risky evaluation patterns.

