Skip to content
Access control Disclosed report Advanced CVE-2022-38473

Cross-origin frames can obtain top-level permissions b/c XSLT transform resets FeaturePolicy

An XSLT transformation copies properties from the source document to the result document but does not carry over the document's FeaturePolicy, leaving the result with a permissive default. A cross-origin iframe could therefore obtain top-level permissions such as webcam, microphone or fullscreen access, or trigger permission prompts in the top-level origin's name.

Armin Ebert Follow

Originally disclosed on Mozilla

  • Fixed in 60 days
  • Paid in 2 months
  • Disclosed after 60 days

Created attachment 9278689 Proof of concept to be loaded in a cross-origin iframe

Cross-origin children can obtain top-level permissions using XSLT because transformation effectively resets the document's FeaturePolicy.

Impact

The attack potential is very similar to bug 1755081. An untrusted cross-origin <iframe> may hijack the top-level origin's permissions to access media devices like the webcam, or prompt for permissions in the top-level origin's name.

Details

During XSL transformation, several properties of the source document are transferred to the result document in URIUtils::ResetWithSource(). Currently this doesn't consider the document's FeaturePolicy.

However, it's necessary to explicitly set the correct FP here, because the result document never runs Document::StartDocumentLoad() => Document::InitFeaturePolicy() to set the policy itself. Hence, the FP remains at its permissive default which, in a nested context (viz. cross-origin iframe), is equivalent to a blanket delegation of all permissions by the top-level context.

Proof of concept

Load the attached PoC in a cross-origin frame. Click the buttons to demo microphone/fullscreen access. Note that parent doesn't require HTTPS, but the PoC itself needs to be served securely so that navigator.mediaDevices is available.

The fullscreen case even works if HTML-sandboxed via e.g.:

HTML
<iframe sandbox="allow-scripts" src="https://untrusted.example/poc-with-acao-header.xml"></iframe>

The original report as published on Mozilla's Bugzilla, by Armin Ebert. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 XSLT result document is created without running the normal document-load initialisation that sets the FeaturePolicy, and the reset routine does not copy the source document's policy, so the permissive default applies.

What the attacker needed

Victim loads a page with a cross-origin iframe; attacker controls the framed document; PoC served over HTTPS for media APIs

The fix

The XSLT reset routine should explicitly set the correct FeaturePolicy on the result document, since it never goes through the normal initialisation path.

How it was found

  1. Load the proof-of-concept document inside a cross-origin iframe.
  2. Click the buttons in the frame to demonstrate microphone and fullscreen access.

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 use a policy to decide which powerful features (camera, microphone, fullscreen) a page and its embedded frames are allowed to use. When a page is transformed with XSLT, a language for reshaping XML into other markup, the browser builds a new document but forgets to copy that policy over, so the new document gets the most permissive setting. That lets an embedded frame from another site ask for features it should not have been granted.

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.

More by Armin Ebert

View all

18 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.