Skip to content
XSS Write-up Beginner

From a Phone Number Tweak to Total Account Takeover  How an RFC

A phone number change form accepted RFC 3966 formatted input and reflected it without sanitisation, allowing script injection. An attacker could steal session cookies and take over accounts.

horamah Follow

Published on medium.com

Hey everyone! 👋 I’m @horamah.71, sharing my latest research, exploits, and security discoveries.

horamah, 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

The application reflected user-supplied phone number input, including RFC 3966 parameters, into the DOM without sanitisation.

Impact

An attacker could steal session cookies and take over user accounts, gaining full access to profiles, messages, and settings.

What the attacker needed

Victim visits a page that displays the phone number; attacker can submit a phone number change

The fix

The application should sanitise and validate all parts of user input, especially structured formats like phone numbers, and use a strict Content Security Policy.

How it was found

  1. Open the Change Phone Number form.
  2. Enter a phone number containing a script payload.
  3. Submit the form and observe the script executing.
  4. Inject a payload that sends cookies to an attacker server.
  5. When a verified user visits a restricted page, the payload executes and sends their cookies.
  6. Use the stolen cookies to log in as the victim.

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 phone number field let people type extra characters that were shown on the page without being cleaned. When another user visited a page that displayed that number, the hidden code ran in their browser and sent their login cookie to the attacker. The attacker then used the cookie to log in as the victim.

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.