# [accounts.reddit.com] Redirect parameter allows for XSS

The dest parameter on accounts.reddit.com accepted a javascript: URI, executing XSS after login, allowing cookie theft.

- Payout: $5,000
- Severity: high
- Program: Reddit
- Found by: dvorakxl
- Disclosed: 2023-05-18
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1962645
- Library page: https://bugbountylibrary.com/r/h1%3A1962645
- Tags: area:web domain:web impact:ato kind:bounty platform:hackerone sev:high tech:sso technique:recon vuln:open-redirect vuln:xss

**Target:** accounts.reddit.com login redirect (dest parameter)
**Root cause:** The dest redirect parameter was not validated against an allowlist of schemes/paths, so a javascript: URI was passed through and later navigated to after authentication.
**Steps:**
1. Visit `https://accounts.reddit.com/?dest=javascript:alert(document.domain)`
2. If logged out, log in; if logged in, page loads directly
3. XSS fires in the accounts.reddit.com origin
**How found:** Researcher was tampering with the dest parameter and tested a javascript: scheme payload.
**Exploitation:** Attacker sends victim the crafted URL; after the victim authenticates (or if already logged in), the app navigates to the dest value, executing attacker JS in the accounts.reddit.com origin to steal cookies/session.
**Insight:** On SSO/login redirect params, test javascript:/data: schemes, not just open-redirect to external hosts; the post-login navigation sink is where the payload executes.

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

**Malicious dest parameter javascript:alert URL**

```
https://accounts.reddit.com/?dest=javascript:alert(document.domain)
```

