Cross-origin Shared Worker using data: url
A cross-origin SharedWorker could be created using a data: URL, allowing a worker from one origin to be shared with another origin. An attacker could use this to run code in the context of a victim origin, potentially leading to data theft or other attacks.
- Fixed in 15 days
- Paid in 28 days
- Disclosed after 15 days
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Steps to reproduce:
1. Go to http://test.shhnjk.com/2.html
2. Click on open another window button.
3. Click on stop button on one tab
Actual results:
Both tabs stopped counting (SharedWorker established cross-origin).
Expected results:
In https://html.spec.whatwg.org/multipage/workers.html#sharedworker, step 11.2's note of "When the SharedWorker(scriptURL, options) constructor is invoked:" says
data: URLs create a worker with an opaque origin. Both the constructor origin and constructor url are compared so the same data: URL can be used within an origin to get to the same SharedWorkerGlobalScope object, but cannot be used to bypass the same origin restriction.
This is not the case in Firefox and cross-origin site can create SharedWorker using data URL SharedWorker 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 browser did not properly enforce the same-origin policy for SharedWorker scripts loaded from data: URLs, allowing cross-origin access.
Impact
A malicious site could create a SharedWorker that is accessible from a different origin, potentially allowing it to interfere with or read data from that origin.
What the attacker needed
Victim visits attacker page; victim opens another window; victim interacts with the page
How it was found
- Go to the test page.
- Click the button to open another window.
- Click the stop button on one tab.
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.
A SharedWorker is a background script that multiple browser tabs can share. Normally, only pages from the same website can share one. This report shows that a page from one website could create a SharedWorker using a special data: URL and then another website could connect to it, breaking the same-origin rule that keeps websites separate.
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.