WebSocket Misconfiguration Leading to DOM Manipulation and Denial of Service in a Web Chat…
The chat application's WebSocket server forwarded client-supplied user objects to other connected clients without validation, and the React client rendered a manipulated field as text, causing a runtime error. An attacker could crash the chat dashboard for other users, producing a client-side denial of service.
Published on waleedosamaeg.medium.com
Hello again, my friends 👋 While continuing to analyze the fully WebSocket‑based chat application we discussed in the previous write‑up, I stumbled upon a new vulnerability — more dangerous and with a significantly higher impact — within the same application.
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
Likely the server trusted and rebroadcast client-controlled WebSocket data without schema validation, and the React client rendered an unexpected object value as text.
Impact
Other connected users could have their online-users component, and sometimes the whole dashboard, crash, causing a client-side denial of service; the attacker's own client was unaffected.
What the attacker needed
A chat account; ability to edit localStorage; victim has the chat open
The fix
The server should validate the received object against the expected schema and verify that the user ID belongs to the current session before forwarding a sanitised version to other clients.
How it was found
- Open the chat dashboard and inspect the current_user object stored in localStorage.
- Change the age value from a number to an empty object.
- Wait for the periodic refreshing_state message to send the modified object over the WebSocket.
- Observe that the attacker's own client does not render the modified value.
- Open the chat with a new account and see the dashboard crash with a white screen.
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.
A chat app let each user's browser send a small profile object to the server every few seconds. The server passed that object to everyone else without checking it, and the other browsers tried to display a field that was no longer a simple number, so their page crashed. This is a denial of service: the attacker does not steal data, but makes the app unusable for others.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.