Bug 1565373 - Use the intrinsic storage principal when inheriting directly; r=baku

We shouldn't perform an anti-tracking check here, since that may result
in us picking the node principal unintentionally.

Differential Revision: https://phabricator.services.mozilla.com/D37811
This commit is contained in:
Ehsan Akhgari
2019-07-12 09:08:38 +00:00
parent 995877719e
commit 297dbc461e
2 changed files with 10 additions and 2 deletions

View File

@@ -9153,7 +9153,7 @@ nsresult nsDocShell::MaybeHandleSameDocumentNavigation(
} else {
newURITriggeringPrincipal = aLoadState->TriggeringPrincipal();
newURIPrincipalToInherit = doc->NodePrincipal();
newURIStoragePrincipalToInherit = doc->EffectiveStoragePrincipal();
newURIStoragePrincipalToInherit = doc->IntrinsicStoragePrincipal();
newCsp = doc->GetCsp();
}
// Pass true for aCloneSHChildren, since we're not
@@ -9717,7 +9717,7 @@ nsIPrincipal* nsDocShell::GetInheritedPrincipal(
//-- Get the document's principal
if (document) {
nsIPrincipal* docPrincipal = aConsiderStoragePrincipal
? document->EffectiveStoragePrincipal()
? document->IntrinsicStoragePrincipal()
: document->NodePrincipal();
// Don't allow loads in typeContent docShells to inherit the system