XSS via React element spoofing
A cross-site scripting vulnerability existed on Imgur because a URL parameter was parsed into an object that could spoof a React element, allowing an attacker to inject HTML with an event handler. An attacker could execute JavaScript in a victim's browser when they visited a crafted link, potentially performing actions as the victim or reading the session cookie.
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 5 days
Hello, I noticed an XSS on imgur. Proof of concept: visit the URL
It's not the simplest case as it requires some React magic. There is a good explanation of this type of vulnerabilities at http://danlec.com/blog/xss-via-a-spoofed-react-element . Corresponding H1 report: https://hackerone.com/reports/49652 .
The impact is as usual. The attacker could execute operations on behalf of the victim who visits a malicious link, or access e.g. the session cookie (IMGURSESSION).
I haven't yet checked if this the only such occurrence on Imgur.
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
Likely the application passed user-controlled URL parameters into a React element creation function without validating that the object was a genuine React element, allowing an attacker to set properties like dangerouslySetInnerHTML.
Impact
The attacker could execute operations on behalf of the victim who visits a malicious link, or access the session cookie (IMGURSESSION).
What the attacker needed
Victim clicks a crafted link
How it was found
- Craft a URL with parameters that spoof a React element and include an HTML payload with an event handler.
- Send the URL to a victim or trick them into visiting it.
- The victim's browser executes the injected JavaScript.
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.
Cross-site scripting (XSS) is when an attacker can make a website run their own JavaScript in another user's browser. Here, the site took a specially crafted link and treated part of it as a React element, which let the attacker sneak in an image tag with an error handler that runs code. The victim just has to click the link for the code to run.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.