diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index 2343aae339b89..778ee66b5a20e 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc @@ -10447,12 +10447,15 @@ bool NavigationRequest::IsFencedFrameRequiredPolicyFeatureAllowed( network::GetPermissionsPolicyFeatureList(origin); // Check if the outer document's permissions policies allow all of the - // required policies. - std::optional - embedder_allowlist = GetParentFrameOrOuterDocument() - ->GetPermissionsPolicy() - ->GetAllowlistForFeatureIfExists(feature); - if (embedder_allowlist && !embedder_allowlist->MatchesAll()) { + // required policies. Note: GetAllowlistForFeatureIfExists() must NOT be used + // here — it returns nullopt (rather than an empty allowlist) when the + // feature is disabled in the embedder via inheritance, which would let a + // nested embedder bypass its top-level page's Permissions-Policy opt-out. + const network::PermissionsPolicy::Allowlist embedder_allowlist = + GetParentFrameOrOuterDocument() + ->GetPermissionsPolicy() + ->GetAllowlistForFeature(feature); + if (!embedder_allowlist.MatchesAll()) { return false; }