-
Notifications
You must be signed in to change notification settings - Fork 179
Description
Currently, local schemes (such as about:srcdoc) do not inherit the PP header of their parents. This poses an issue if we have an origin A with a PP header of microphone=(self) which includes a about:srcdoc. If this local scheme iframe includes a cross-origin iframe (<iframe allow='microphone' src='https://malicious/'>), this last iframe (https://malicious) can request access for the permission. Instead, if the https://malicious iframe gets included directly on origin A, it can't request access because of the PP header. The example is the following one:
- Origin A:
PP header: microphone=(self)- iframe
src=”https://malicious” allow=”microphone”--> Not allowed to prompt - about:srcdoc
- iframe
src=”https://malicious” allow=”microphone”--> Allowed to prompt
- iframe
- iframe
With local schemes not inheriting the PP header, every website with an HTML injection and allowing self (which is necessary to allow anything at the moment: #480) could be exploited.
The attack is almost identical to the <iframe srcdoc="<script>alert(1);</script>"></iframe> case in CSP that was mitigated by deciding to inherit the header (https://w3c.github.io/webappsec-csp/#security-inherit-csp). The general discussions on inheritances also seemed to conclude that local schemes should inherit: w3ctag/design-principles#111
The idea was also suggested here: #513 (comment)