Skip to content
XSS Disclosed report Beginner

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.

kasperkarlsson Follow

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

blockchain_info_block-index_XSS_h1_Firefox.png
blockchain_info_block-index_XSS_h1_Firefox.png From the original on HackerOne
blockchain_info_block-index_XSS_marquee_Chrome.png
blockchain_info_block-index_XSS_marquee_Chrome.png

The original report as published on HackerOne, by kasperkarlsson. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Craft a URL for the block-index page where the final path segment contains HTML markup.
  2. Open the crafted URL in a browser.
  3. 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.

More by kasperkarlsson

View all

2 more disclosed reports, best first.

More from Blockchain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.