Skip to content
XSS Disclosed report Beginner

xss in /users/[id]/set_tier endpoint

The /users/[id]/set_tier endpoint returns the 'tier' parameter with a text/html Content-Type instead of JSON, allowing reflected cross-site scripting. An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing cookies or escalating privileges.

gabriel-kimiaie Follow

Originally disclosed on HackerOne

  • Triaged in 11 hours
  • Fixed in 11 hours
  • Disclosed after 12 hours

Summary:

[add summary of the vulnerability] Hello there ! I found an XSS since you forgot to add the json content-type response header right there: https://github.com/gtsatsis/RLAPI-v3-OOP/blob/508d3c610ccc9076753bdc81151a5e8d76871a3e/src/Controller/UserController.php#L93 The tier parameter is therefore returned with the wrong Content-Type (text/html). I have been able to verify the existance of the XSS. Note that you can bypass the '' added to both " & / by using comments such as:

Steps To Reproduce:

[add details for how we can reproduce the issue]

  1. Deploy to a test instance
  2. Create one admin user with correct api key filled in the database
  3. the /users/[id]/set_tier "tier" POST parameter is vulnerable to XSS injection.

Supporting Material/References:

  • Selection_033.png =>burp capture attached

Impact

Reflected cross site scripting should be fixed, as an user might be able to steal cookies/escalate privileges.

Attachments

Selection_033.png
Selection_033.png From the original on HackerOne

The original report as published on HackerOne, by gabriel-kimiaie. 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 endpoint did not set the JSON content-type response header, causing the browser to interpret the response as HTML and execute injected scripts.

Impact

An attacker could steal cookies or escalate privileges via reflected cross-site scripting.

What the attacker needed

Admin user with API key

How it was found

  1. Deploy the application to a test instance.
  2. Create an admin user with a correct API key in the database.
  3. Send a request to the /users/[id]/set_tier endpoint with a malicious 'tier' POST parameter to trigger XSS.

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.

When a web server sends data back to the browser, it includes a Content-Type header that tells the browser how to interpret the data. If the server says the data is HTML, the browser will run any scripts in it. Here, the server mistakenly said the data was HTML, so an attacker could put a script in the 'tier' parameter and have it run in a victim's browser.

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 gabriel-kimiaie

View all

1 more disclosed report, best first.

More from RATELIMITED

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.