Pusher vs. Slanger
Slanger 0.6.0 deserialises untrusted WebSocket messages using Oj.load, which can instantiate arbitrary Ruby objects. An attacker could send a crafted message to achieve remote code execution.
honoki.net
Published on honoki.net
Pusher is a product that provides a number of libraries to enable the use of WebSockets in a variety of programming languages. WebSockets, according to their website, “represent a standard for bi-directional realtime communication between servers and clients.”
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application deserialised untrusted input with Oj.load, which by default can instantiate arbitrary Ruby objects, enabling gadget-chain code execution.
Impact
An attacker could execute arbitrary commands on the server; one exploit variant did not require knowing the app key.
What the attacker needed
Network access to the Slanger WebSocket endpoint; knowledge of the app key (for one variant)
How it was found
- Connect to the Slanger WebSocket endpoint.
- Send a message containing a serialised Ruby object.
- The server deserialises the message with Oj.load, triggering the gadget chain.
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 write-up has not been written yet. The Original tab links to the source.
Slanger is a server that speaks the Pusher protocol for real-time messaging. It used a JSON parser that can also rebuild Ruby objects from text, and it did so on messages from any user. That let an attacker send a message that made the server run their code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.