How I Found an HTML Injection in a Bug Bounty Program
A web form reflected the 'name' parameter without sanitisation, allowing HTML tags to be rendered. An attacker could inject headings and links, enabling phishing or defacement.
medium.com
Published on medium.com
I’m Muhammed Galal, a cybersecurity researcher and ethical hacker specializing in web and mobile application penetration testing. As a bug hunter on platforms like HackerOne and Bugcrowd, I have successfully identified vulnerabilities in major companies, including Xiaomi and Twitter.
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 failed to sanitise or encode user input before inserting it into the HTML response.
Impact
An attacker could use the injected HTML to conduct phishing attacks by tricking users into clicking malicious links, or deface the webpage; session hijacking is only possible if combined with other vulnerabilities.
What the attacker needed
Access to the web form; Victim visits crafted URL
The fix
The application should properly validate and sanitise user input before rendering it in HTML.
How it was found
- Enumerate subdomains and filter active ones.
- Search archived URLs for interesting endpoints.
- Find a contact form endpoint with a reflected 'name' parameter.
- Inject a basic HTML heading tag and observe it rendered as a heading.
- Inject an anchor tag and confirm a clickable 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 a website takes what you type and puts it straight into the page without cleaning it, you can type special formatting codes (HTML) that the browser will display as real content. Here, the author typed a heading tag and a link tag, and the site showed them as a big heading and a clickable link. This lets an attacker make the page show fake links or messages.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.