Closed
Bug 2080758
Opened 4 days ago
Closed 1 day ago
iframe allow PermissionsPolicy if the child allow it and parent block it
Categories
(Core :: DOM: Security, defect, P3)
Core
DOM: Security
Tracking
()
RESOLVED
DUPLICATE
of bug 2081658
People
(Reporter: ahedri, Assigned: ahedri)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
TL;DR
A parent document at https://a.example.com sets the following Permissions-Policy header:
Permissions-Policy: fullscreen=(self)
The parent contains a cross-origin iframe:
<iframe src="https://b.example.com" allow="fullscreen *"></iframe>
The cross-origin iframe is still able to enter fullscreen, even though the parent's Permissions-Policy header restricts fullscreen to same-origin contexts.
Cause
in PermissionsPolicy::InheritPolicy we have
if (!src->AllowsFeatureInternal(featureName, src->mDefaultOrigin) &&
!src->AllowsFeatureInternal(featureName, dest->mDefaultOrigin)) {
dest->SetInheritedDeniedFeature(featureName);
}
The current condition denies the feature only when the source allowList disallows it for both the source own origin and the destination origin. However In the spec, these are separate steps. Therefore the two checks should be joined with || and not &&.
However doing just that fixed the issue but also made some regressions so I'll take a deeper look at what is going on
Flags: behind-pref+
Blocks: permissions-policy-header
You need to log in
before you can comment on or make changes to this bug.
Description
•