Day 7: Drag & Drop XSS + Cookie Bomb for OAuth Hijacking
The platform used jQuery's .html() to process dropped image URLs, allowing an attacker to inject script when a victim drags an image. Combined with a missing OAuth state parameter and a cookie bomb that caused a header-too-large error, the attacker could steal the OAuth token and log in as the victim.
Published on medium.com
📌 Issue: html() is used instead of text(), leading to XSS when an attacker-controlled image is dropped.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the use of jQuery's .html() instead of .text() to process user-supplied image URLs, combined with a missing OAuth state parameter and no limit on cookie size.
Impact
The attacker could log into the victim's account remotely, though the OAuth token expired immediately when used by the server, which was bypassed with the cookie bomb.
What the attacker needed
Victim drags an attacker-controlled image; OAuth login from a parent domain; attacker can set many large cookies
How it was found
- The attacker tricks the victim into dragging an image.
- Using dataTransfer.setData(), the payload gets injected into the image's href value.
- When the image is dropped, XSS is triggered.
- Fill the victim's cookies with large values (8KB+ per cookie).
- When the OAuth response arrives, the server rejects it due to Header Too Large error.
- The attacker then steals the OAuth token from the URL.
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 write-up has not been written yet. The Original tab links to the source.
The site took an image link and inserted it into the page as HTML instead of plain text, so a malicious link could run code in the victim's browser. Separately, the login flow did not use a security code (state parameter) to tie the login response to the right user, and the attacker overloaded the victim's cookies so the server rejected the login response, letting the attacker grab the token from the URL.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.