How a Single Quote Turned a Safe Markdown Feature Into a Security
HackerOne's Markdown parser allowed a dangling single quote to be preserved in generated HTML, and when combined with a meta refresh tag, this could cause the browser to include subsequent page content in a request to an attacker-controlled URL. The researcher demonstrated that single quotes could be injected after sensitive data like CSRF tokens, but could not fully weaponise the bug.
Published on medium.com
In early 2016, a subtle misconfiguration in HackerOne’s Markdown rendering pipeline led to an interesting and unexpected security issue one that highlighted how small parsing quirks can snowball into serious impact.
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 failed to properly escape or strip a dangling single quote, and the application used dangerouslySetInnerHTML to inject the resulting HTML without further sanitisation.
Impact
The researcher could not fully weaponise the bug, but demonstrated that single quotes could be injected after sensitive data and that a future injection point in a meta tag could turn this into a full content exfiltration attack.
What the attacker needed
Markdown rendering with dangling quote; Use of dangerouslySetInnerHTML; Injection point in a meta tag
The fix
The issue was fixed by HackerOne, though the text does not specify the exact fix.
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 it usually turns into safe HTML. Here, a small mistake let a single quote character survive into the final web page. If that quote appears inside a special tag that tells the browser to redirect, everything after it can be sent to another website, potentially leaking secret tokens.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.