Reflected XSS on blockchain.info
The block-index page reflected part of the URL path into the HTML without encoding, allowing an attacker to inject HTML elements. Due to a strict Content Security Policy, arbitrary JavaScript could not be executed, so the impact was limited to HTML injection.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 21 days
- Paid in 20 days
- Disclosed after 4 months
The application at https://blockchain.info is vulnerable to reflected XSS/HTML injection through the URL at the block-index page.
Proof of concept
The following PoC contains the payload "><h1>XSS here which displays the text in heading size.
https://blockchain.info/en/block-index/1160457/%22%3E%3Ch1%3EXSS%20here
Another example with some scrolling text "><marquee>XSS here:
https://blockchain.info/en/block-index/1160457/%22%3E%3Cmarquee%3EXSS%20here
Print screens from the two PoCs above are attached to this report. This was tested using Mozilla Firefox 49.0.2 and Google Chrome 54.0.2840.71.
Due to the strict Content Security Policy which even blocks 'self', arbitrary javascript cannot be executed through this vulnerability without some CSP bypass. Great! :)
Recommended solution
Make sure to properly encode the last part of the URL before printing it to the page. Another possible solution is to make sure the URL matches a strict whitelist regexp, so that this part of the URL is not put on the page at all if it looks fishy.
Attachments


Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application printed the last part of the URL path into the HTML page without encoding it.
Impact
An attacker could inject arbitrary HTML into the page, but the strict Content Security Policy prevented JavaScript execution, so the impact was limited to HTML injection.
What the attacker needed
Victim clicks a crafted link
How it was found
- Craft a URL for the block-index page where the final path segment contains HTML markup.
- Open the crafted URL in a browser.
- Observe that the HTML is rendered as elements (e.g., a heading or marquee) instead of being shown as text.
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 report has not been written yet. The Original tab links to the source.
When a website takes something from the URL and puts it directly into the page without cleaning it, an attacker can craft a link that makes the page show their own content. Here the site inserted part of the web address into the HTML, so a specially crafted link could display a heading or scrolling text. However, the site had a security rule (Content Security Policy) that stopped any JavaScript from running, so the attacker could not steal data or take over accounts.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.