Skip to content
XSS Write-up Intermediate

The one where I owned a customer service platform

A reflected XSS in the locale parameter of a knowledge-base page allowed an attacker to execute JavaScript in a victim's browser. By commenting out a meta-tag CSP and loading an external script, the attacker could add themselves as an admin to any tenant whose public knowledge-base page leaked the required company and unique identifiers.

un1tycyb3r Follow

Published on medium.com

Let’s refer to this platform as ABC Communications since they don’t allow disclosure. Let’s dive into this awesome bug I found where I turned a simple XSS into a cool but simple bug chain that allowed myself to add myself as an admin of any tenant of this particular customer service platform.

Un1tycyb3r, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the application failed to sanitise the locale parameter before reflecting it into the page, and the CSP was implemented via a meta tag that could be commented out by the injected payload.

Impact

An attacker could add themselves as an admin to any tenant on the platform by tricking a user into visiting a crafted link, but the exploit required knowledge of the tenant's company ID and unique IDs, which were publicly leaked on the knowledge-base page.

What the attacker needed

Victim clicks a crafted link; attacker knows company ID and unique IDs; public knowledge-base page leaks IDs

How it was found

  1. Identify that the locale parameter is reflected in the response.
  2. Inject a payload that breaks out of the context and executes script, such as an SVG with an onload handler.
  3. Append a comment sequence to the payload to comment out the meta-tag CSP.
  4. Load an external script that performs the administrative action.
  5. Obtain the company ID and unique IDs from the public knowledge-base page.
  6. Craft a URL that, when visited by a victim, adds the attacker as an admin to the victim's tenant.

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

The application reflected user input from a URL parameter directly into the page without proper sanitisation, letting an attacker run their own JavaScript in a victim's browser. The attacker then bypassed a security policy that was supposed to block such scripts, and used the ability to run code to perform administrative actions on behalf of the victim. The victim only needed to visit a crafted link.

What is XSS?

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

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.