SOP bypass using drag and drop of image.
A drag-and-drop interaction with an image from a popup that closes during the drag causes the browser to create a File object containing the cross-origin image's contents. An attacker could use this to read data from another origin, bypassing the same-origin policy.
Originally disclosed on Mozilla
- Fixed in 2.9 years
- Paid in 9 months
- Disclosed after 2.9 years
Created attachment 8817834
PoC-SOPB.html
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Steps to reproduce:
When closing opened popups whilst dragging an image from that popups the dragged object contains a File object once dropped on cross origin document.
1. Open attached PoC
2. Press button to open window
3. Attempt to drag the box as instructed
4. After popup closes, drop the 'image' anywhere on the document
We end up with full contents of a cross origin website.
Actual results:
A file object is created for some reason with the contents of a cross origin image, despite the image being invalid.
Expected results:
Same as when we don't close the window, no File object should be created unless the image loads, even then we should block it if the image is cross origin.
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 browser fails to clear or validate the drag data when the source window closes, creating a File object from a cross-origin image that should not be accessible.
What the attacker needed
Victim uses a vulnerable browser; victim drags an image from a popup; popup closes during the drag
How it was found
- Open the provided proof-of-concept page.
- Press the button to open a popup window.
- Attempt to drag the box as instructed.
- After the popup closes, drop the 'image' anywhere on the document.
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.
Websites are normally not allowed to read data from other websites (this is the same-origin policy). This bug shows that if you start dragging an image from a popup and the popup closes mid-drag, the browser wrongly hands over the image's data to the page you drop it on, even though it belongs to a different site.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.