# Cross-site scripting on algorithm collaborator 

Stored XSS via unencoded HTML in TogetherJS websocket debugger messages, executing JavaScript in algorithm collaborators' browsers.

- Payout: $2,100
- Severity: high
- Program: Quantopian
- Found by: irisrumtub
- Disclosed: 2022-12-21
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/615672
- Library page: https://bugbountylibrary.com/r/h1%3A615672
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:high tech:websocket technique:js-analysis vuln:xss

**Target:** Algorithm debugger websocket (TogetherJS) on www.quantopian.com
**Root cause:** Server relays debugger input updates over websocket without HTML-encoding, so raw HTML/JS in the message value is rendered in collaborators' browsers.
**Steps:**
1. Open algorithm debugger as a collaborator session.
2. Intercept the websocket message for debugger input update.
3. Replace the value field with `<img src=x onerror=alert(1)>`.
4. Send the message; payload executes in the collaborator's browser.
**How found:** Noticed a request to /algorithms/algoid/x triggered by an <img src=x> payload, then observed the debugger stripped the image portion of the payload. Tried HTML entities (no effect) and saw injection only on own side, so inspected the websocket request and found <> were encoded client-side; intercepting and sending raw HTML bypassed it.
**Exploitation:** Attacker with collaborator access intercepts the TogetherJS websocket debugger-input message and injects raw HTML/JS; the server broadcasts it unencoded to other collaborators, executing in their browsers.
**Insight:** When a UI sanitizes/strips payloads client-side, intercept the underlying websocket/transport message and send raw markup directly—server-side encoding may be missing even if the client encodes.

## Proof of concept (copied exactly from the original report)

**Websocket debugger input update message with XSS payload**

```
Intercept websockets message like this (debugger input update)
{F509648}
  2. Replace value with raw html/javascript
```

