Skip to content
XSS Write-up Beginner

HTML Injection Unleashed: Cracking the Door Open to Full Account

The login page reflected the username field into the page without sanitising it, so raw HTML was rendered after a login attempt. An attacker could inject a link that redirects the victim to a fake login page to harvest credentials, which the author claims could lead to account takeover.

Hamzawy | 0xMo3Gza Follow

Published on medium.com

The login page fails to sanitize input in the username field, allowing raw HTML to be injected and rendered on the page after submission. This creates a client-side injection point that can be escalated depending on how the application reflects the data post-login attempt.

Hamzawy | 0xMo3Gza, 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 username value was written into the page's HTML without encoding, so injected markup was rendered instead of shown as text.

Impact

An attacker could render a link on the login page that sends users to a phishing page to capture credentials, which the author says could lead to account takeover; the report does not show script execution actually occurring.

What the attacker needed

Victim visits the crafted login link; victim clicks the injected link

How it was found

  1. Open the login page.
  2. Enter a username containing an HTML link to an attacker-controlled page.
  3. Submit and continue to the password page.
  4. The injected link is rendered on the page and redirects the victim to the attacker's fake login page.

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 into a login form, the site should treat your text as plain text. Here it instead placed the text straight into the page as HTML, the code that builds web pages, so a crafted username could add a clickable link. The attacker uses that link to send the victim to a lookalike login page and steal their password.

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 Hamzawy | 0xMo3Gza

View all

2 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.