Skip to content
XSS Disclosed report Intermediate

HTML injection (with XSS possible) on the https://www.data.gov/issue/ using media_url attribute

The media_url parameter on the data.gov issue page reflected user input into the HTML without sanitisation, allowing HTML injection and, with a WAF bypass, reflected cross-site scripting. An attacker could craft a link that runs script in a victim's browser on the data.gov origin.

sp1d3rs Follow

Originally disclosed on HackerOne

  • Paid in 3 days
  • Disclosed after 21 days

Summary by the researcher

Thanks to the 18F team for the great experience, fast fix, and the bounty!

This XSS was undetectable by the most XSS scanners due to WAF in place. I noticed the reflection upon exploring the huge list of URLs (grabbed from the Google Search) manually. The WAF bypassing was an actual pain - it blocked almost all (but not all!) useful things (tags, events, etc.). There were 3 endpoints in total, affected by this issue.

###References Thanks to the @brutelogic and his awesome filter and WAF evasion tips on the @brutalsecrets - one of those tips helped me to bypass the Kona WAF after 6 hrs of pain. You may notice, that I even used the brute tag in the payload:)

The report

##Description Hello. I discovered Cross-Site scripting issue on the https://www.data.gov/issue/ endpoint.

##Akamai WAF and bypass At the srart i was not able to do the XSS due to Akamai Waf XSS filters, but later, i was able to bypass it.

##POC (HTML injection) https://www.data.gov/issue/?media_url=catalog.data.gov/dataset/consumer-complaint-database%22%3E%3Csvg%20height=%22100%22%20width=%22100%22%3E%20%3Ccircle%20cx=%2250%22%20cy=%2250%22%20r=%2240%22%20stroke=%22black%22%20stroke-width=%223%22%20fill=%22red%22%20/%3E%20%3C/svg%3E

c.PNG
c.PNG From the original on HackerOne

##POC (Reflected XSS) Use this link in the Mozilla Firefox https://www.data.gov/issue/?media_url=catalog.data.gov/dataset/consumer-complaint-database%22%3E%3C/div%3E%3C/div%3E%3Cbrute%20onbeforescriptexecute=%27confirm(document.domain)%27%3E

cx.PNG
cx.PNG From the original on HackerOne

##Suggested fix Sanitize all input fields on this page.

The original report as published on HackerOne, by sp1d3rs. 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

Likely the media_url query parameter was written into the page markup without output encoding or sanitisation.

Impact

An attacker could run script in a victim's browser on the data.gov origin via a crafted link, though the Akamai WAF blocked most payloads and a bypass was needed.

What the attacker needed

Victim clicks a crafted link; WAF bypass needed for script execution

How it was found

  1. Open the issue page with a crafted media_url value containing HTML markup.
  2. Observe the injected SVG element rendered in the page.
  3. Use a second crafted value that closes the surrounding divs and adds an element with an event handler.
  4. Load the link in Firefox and see the script execute.

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.

A web page took a value from the address bar and pasted it straight into the page's HTML without cleaning it. By putting special characters in the link, an attacker can add their own HTML or a small script, so anyone who opens the crafted link runs that code as if data.gov had served it.

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 sp1d3rs

View all

62 more disclosed reports, best first.

More from GSA Bounty

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.