Skip to content
Access control Write-up Beginner

It Started With Csrf But Wait Xss Potential Sqli

The email update endpoint trusted a username value stored in a cookie, allowing an attacker to change another user's email address without authentication. The email field also reflected a script payload, leading to reflected cross-site scripting.

callgh0st Follow

Published on infosecwriteups.com

It’s been a while since I last posted, so I’m back with a write-up of a CSRF lab from the TCM Bug Bounty Course.

callgh0st, on infosecwriteups.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 trusted a user-controlled cookie value to identify the account being modified, and failed to sanitise the email input before reflecting it.

Impact

An attacker could take over another user's account by changing their email and then resetting the password; the email field also allowed reflected cross-site scripting.

What the attacker needed

A free account; victim clicks a link

How it was found

  1. Log in as Jeremy and intercept the email update request.
  2. Change the username in the cookie from Jeremy to Jessamy.
  3. Send the request and observe that Jessamy's email is updated without logging in as her.
  4. Enter a script payload in the email field and observe a reflected response.

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.

A website used a cookie to decide which user's email to update, instead of checking who was logged in. By changing the cookie value, an attacker could update someone else's email and then take over their account. The email field also echoed back a script, which could run in a victim's browser.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by callgh0st

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.