Persistent XSS in https://p.imgur.com/albumview.gif and http://p.imgur.com/imageview.gif / post statistics
A parameter in the albumview.gif and imageview.gif endpoints was not properly escaped, allowing an attacker to inject HTML and JavaScript that would execute in a victim's browser. The reporter demonstrated this with example URLs containing script tags.
Originally disclosed on HackerOne
- Fixed in 8 hours
- Paid in 16 days
- Disclosed after 41 days
Summary by the program
In p.imgur.com/albumview.gif, a post paramater could be set containing html and javascript. This was not escaped properly and the code would be executed.
The reporter used the following example URLs as a proof of concept
https://p.imgur.com/albumview.gif?a=F78FO&r=https://community.imgur.com/<script>alert(2)</script>
http://p.imgur.com/imageview.gif?a=kCaIJRa&r=https%3A%2F%2Fcommunity.imgur.com/%3Cscript%3Econsole.log%28%27XSS%27,$.cookie%28%29%29%3C/script%3E
https://p.imgur.com/albumview.gif?a=F78FO&r=https://community.imgur.com/"><script>alert(2)</script>
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 application failed to HTML-encode or validate the 'r' parameter before reflecting it into the generated image response.
What the attacker needed
Victim clicks a crafted link
How it was found
- Craft a URL to the albumview.gif endpoint with a malicious script in the 'r' parameter.
- Send the URL to a victim or trick them into visiting it.
- The script executes in the victim's browser.
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.
Here, a parameter was not escaped, so a script tag in the URL would run.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.