HackerOne HTML Injection Fix Bypass
After HackerOne patched an HTML injection issue, the author tested the fix and found that the Markdown parser accepted extra quotes and arbitrary attributes inside a link, generating unintended HTML. The issue was not directly exploitable but could lead to content spoofing and client-side problems.
Published on medium.com
In 2016, after HackerOne patched an HTML injection issue, I decided to test the fix instead of moving on. The idea was simple:
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 Markdown parser did not properly validate or escape quotes and attributes in link titles, allowing arbitrary HTML attributes to be injected into the generated anchor tag.
Impact
The issue was not directly exploitable, but arbitrary HTML generation could lead to content spoofing and client-side issues.
What the attacker needed
Ability to submit Markdown input
The fix
HackerOne reverted the fix and implemented a safer solution.
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.
Markdown is a simple way to format text, and a parser turns it into HTML for the browser. The author found that by adding extra quotes and attributes to a Markdown link, the parser produced HTML it should not have, which could let an attacker fake page content. The bug was not directly exploitable but showed the fix was flawed.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.