Cross-origin embeds/objects can obtain permissions of the top-level origin
A browser bug let a cross-origin document nested inside an <embed> element inherit the top-level site's permission grants, so a third-party advertiser could use the microphone or prompt for geolocation as the parent site. An attacker could therefore access a device sensor without the user granting anything to the attacker's origin.
Originally disclosed on Mozilla
- Fixed in 60 days
- Paid in 60 days
- Disclosed after 60 days
Documents in nested cross-origin browsing contexts can obtain permissions granted to the top-level origin. This could e.g. be a 3rd-party <iframe> accessing the webcam after permission had been given to the parent site, or prompting for geolocation access in the parent's name.
The attack is based on exploiting faulty FeaturePolicy inheritance by inserting a non-<iframe> embedder (e.g. <embed>) in the ancestor chain.
Attack scenario
- The user has granted a permanent microphone permission to
voicechat.example. voicechat.exampleembeds a cross-origin advertisement via<iframe src="https://advertiser.example">.- Once loaded,
advertiser.examplecan access the microphone without user interaction.
If permission had not been granted yet, advertiser.example may also prompt for it. The dialog will then still appear as a request by voicechat.example and not the attacker. (It's by design that the prompt always requests as the top-level origin.)
Proof of concept
(These are identical to the attached poc.zip.)
https://site.example/site.html:
<iframe src="https://attacker.example/attacker_parent.html"></iframe>
https://attacker.example/attacker_parent.html:
<embed src="attacker_child.html"></embed>
https://attacker.example/attacker_child.html:
<button id="ask">access microphone</button>
<div id="info"></div>
<script>
ask.onclick = async function() {
const stream = await navigator.mediaDevices.getUserMedia({audio: true});
info.textContent = `origin ${origin} got ${stream}`;
}
</script>
A click on "access microphone" will give attacker.example access based on the current permissions for site.example. However, it should have been neither promted for nor granted, because the request originates from a cross-origin frame without special permissions.
I'll follow up with more details.
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
Impact
A cross-origin third party could access the microphone after the user had granted it to the parent site, or prompt for geolocation in the parent site's name; the text does not say whether any browser defence blocked it.
What the attacker needed
Victim visits a site that embeds the attacker; top-level site already has a permission grant; attacker uses an <embed> in the chain
How it was found
- The top-level site embeds a cross-origin attacker page in an iframe.
- The attacker page embeds a child page using an <embed> element.
- The child page requests the microphone through getUserMedia.
- The request succeeds using the top-level site's existing permission.
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.
Browsers let a website ask for permission to use things like the microphone or your location, and that permission is tied to the site you are visiting. Normally a different site loaded inside that page is not allowed to use those permissions. Here, a browser mistake meant a different site could still use them, so an advert on a page could listen through your microphone.
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.