Skip to content
XSS Write-up Beginner

This is my third bug bounty report: How I found an XSS vulnerability

A PHP endpoint echoed the password submitted during login back to the page without any filtering, so JavaScript entered there would run. Because the request could be sent automatically from another site, the author turned what was initially self-XSS into reflected XSS and could read cookies.

umuttkyrdgn Follow

Published on umuttkyrdgn.medium.com

Hi everyone! Today I’m going to tell you about a vulnerability I found and discuss the topic of exploit chaining.

Umut Kayra Doğan, on umuttkyrdgn.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 login endpoint reflected the submitted password value into the HTML response without output encoding.

Impact

An attacker could run script in a victim's session and read their cookies, because no HttpOnly protection was in place.

What the attacker needed

Victim loads attacker's page; no HttpOnly on session cookies

How it was found

  1. Notice that a PHP endpoint on the login flow prints the submitted password back to the page.
  2. Confirm that JavaScript placed in the password field runs, which on its own is self-XSS.
  3. Build a page with a form that posts the malicious password to the endpoint automatically.
  4. Have the victim load that page so the script runs in their session and cookies can be read.

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.

When you type something into a website, the site should treat it as text, not as code. Here the login page printed the password back without cleaning it, so a script hidden in the password field would run in the browser. The author then made a page that submits that password automatically, so a victim only has to visit it.

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.