Skip to content
XSS Write-up Beginner

HTML Injection(Unique Exploitation)

The application reflected the X-Forwarded-For header value into the login email without sanitisation, allowing an attacker to inject HTML. An attacker could send a crafted header so the victim's email contained a phishing link styled as a login prompt.

Pratik Yadav Follow

Published on medium.com

Bounty$250 View original

Hey Guys! I know HTML injection is not something you wanted to read but however its an unique issue which i have found.

pratik yadav, 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 trusted the client-supplied X-Forwarded-For header and inserted it into the email HTML without encoding.

Impact

An attacker could make the login email contain a link to an attacker-controlled site, which could be used for phishing; the report does not show any other impact.

What the attacker needed

Ability to set the X-Forwarded-For header; victim receives the login email

The fix

The issue was fixed by the CEO within two minutes, according to the report.

How it was found

  1. Submit the login request that sends the magic link email.
  2. Add an X-Forwarded-For header with a test value and observe it reflected in the email.
  3. Replace the header value with HTML markup and confirm it renders in the email.
  4. Replace the header value with an anchor tag linking to an attacker-controlled site and confirm the link appears.

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 log in, the site sends you an email with a login link and shows your IP address in that email. The site took the IP address from a header that the user can set, and put it into the email without cleaning it. That let the attacker put their own HTML, such as a fake login link, into the email.

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 Pratik Yadav

View all

4 more disclosed reports, best first.

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.