Insufficient policy enforcement in Data Transfer (CVE-2024-7978)
A drag-and-drop download in Chrome did not enforce the same-origin policy for the DownloadURL data type, allowing a page to trigger a download from a cross-origin URL. An attacker could cause the victim's browser to send requests to a third-party server with incorrect fetch metadata and potentially include cookies that should not be sent.
- Fix shipped in 2.1 years
Steps to reproduce the problem:
Run the following on ANY origin.
let link = document.createElement('a');
link.innerText = 'foo'
link.href = '#';
link.addEventListener('dragstart', onDragStart, false);
document.body.appendChild(link);
function onDragStart(e) {
e.dataTransfer.setData('DownloadURL', 'application/octet-stream:demo:https://terjanq.me/xss.php?headers');
e.dataTransfer.effectAllowed = 'all';
}
Drag the foo text on to your desktop.
The file should contain sec-fetch-site: 'none'
Problem Description:
Cross-origin download is meant to be initiated cross-origin, so strict cookies are not sent and fetch metadata is correct.
Also https://bugs.chromium.org/p/chromium/issues/detail?id=714373 was meant to block cross-origin URLs and it seems more convincing this way as a download does not need to be user initiated but drag and drop does.
Additional Comments:
https://terjanq.me/xss.php?headers can be replaced with any server that reports the sent headers.
**Chrome version: ** 103.0.0.0 **Channel: ** Not sure
OS: Windows
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
What the attacker needed
Victim uses Chrome; victim drags a link to desktop
The fix
The browser should enforce the same-origin policy for DownloadURL data during drag-and-drop, blocking cross-origin URLs as previously intended.
How it was found
- Create a link element with text 'foo' and href '#'.
- Add a dragstart event listener that sets the DownloadURL data type to a cross-origin URL.
- Append the link to the document body.
- Drag the link text to the desktop.
- Observe that the downloaded file contains the request headers from the cross-origin server.
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.
When you drag a link to your desktop, the browser downloads the file. This report shows that a malicious website could make the browser download a file from a different website without proper security checks. That could let an attacker trick your browser into sending requests with your cookies or other sensitive information.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.