diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc index 3f31f0d867412..0c73297c9fc5f 100644 --- a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc +++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc @@ -563,6 +563,18 @@ StorageAccessGrantPermissionContext::GetContentSettingStatusInternal( return CONTENT_SETTING_ALLOW; } + // A nonce-partitioned (credentialless) frame must never inherit a + // pre-existing STORAGE_ACCESS grant: the HostContentSettingsMap lookup keys + // only on (requesting_origin, embedding_origin) and is unaware of the + // per-Page nonce. Returning ASK here forces requests through + // DecidePermission(), where the compromised-renderer gate runs and the + // renderer is killed via mojo::ReportBadMessage. + if (render_frame_host && + (render_frame_host->IsCredentialless() || + render_frame_host->GetStorageKey().ForbidsUnpartitionedStorageAccess())) { + return CONTENT_SETTING_ASK; + } + ContentSetting setting = permissions::ContentSettingPermissionContextBase:: GetContentSettingStatusInternal(render_frame_host, requesting_origin, embedding_origin);