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.
- 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 (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

##Suggested fix Sanitize all input fields on this page.
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
- Open the issue page with a crafted media_url value containing HTML markup.
- Observe the injected SVG element rendered in the page.
- Use a second crafted value that closes the surrounding divs and adds an element with an event handler.
- 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.