Finding HTML Injection Vulnerability Using Signup Functionality
The signup form's Username field did not validate or sanitise input, so an injected HTML heading tag was rendered as markup on the confirmation page. An attacker could alter the page's appearance or insert misleading content and links.
medium.com
Published on medium.com
In this article, we’ll explore HTML Injection in a simple and practical way what it is, how to identify it during testing, and how to create a proper Proof of Concept (PoC).
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 echoed the submitted username into the confirmation page without HTML-encoding it.
Impact
An attacker could change how the page looks, add fake or misleading content, or insert malicious links, and the issue could sometimes be used to move toward XSS attacks.
What the attacker needed
Access to the signup form; none
The fix
Input should be validated on both client and server side, and user-controlled data should be encoded before display so it appears as plain text.
How it was found
- Open the signup page.
- Enter an HTML heading tag in the Username field.
- Fill the remaining fields with test data and submit the form.
- Observe the confirmation page rendering the tag as HTML.
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.
HTML injection happens when a website takes text you type and puts it into the page without cleaning it first. The browser then treats that text as instructions for building the page, not as plain words. Here, typing a heading tag into the username box made a real heading appear on the confirmation page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.