Shadowsocks-libev ss-manager add_server Code Execution Vulnerability
The ss-manager component of Shadowsocks-libev accepts unauthenticated commands on a local UDP socket, and its add command lets the caller specify a plugin binary that ss-server then executes. A local attacker could run an arbitrary binary with the privileges of the ss-server process, leading to privilege escalation.
Originally disclosed on Cisco Talos
An exploitable code execution vulnerability exists in the ss-manager binary of Shadowsocks-libev 3.3.2. Specially crafted network packets sent to ss-manager can cause an arbitrary binary to run, resulting in code execution and privilege escalation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the manager socket has no authentication and the plugin parameter is passed straight to process execution without validation.
Impact
A local attacker could execute an arbitrary binary with the privileges of the ss-server process, resulting in privilege escalation; the attack requires local access to the manager socket.
What the attacker needed
Local access to the manager socket; ability to place a binary on the host
The fix
The manager should be configured to use a unix domain socket instead of the default network socket, since exposing it is dangerous.
How it was found
- Send a UDP packet to the manager's local port containing an add command with a plugin value.
- The manager starts a server instance using the supplied configuration.
- The server resolves the plugin name and executes it as a subprocess.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Shadowsocks is a proxy tool that helps people get around internet censorship. Its manager program listens on a local network port and accepts commands without checking who sent them. One command lets the sender name a helper program (a plugin) that the server will start, so anyone who can reach that port can make the server run a program of their choosing.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.