Bug 1232903 - Skip Security checks if triggeringPrincipal is SystemPrincipal (r=sicking)

This commit is contained in:
Christoph Kerschbaumer 2016-03-01 16:11:37 -08:00
parent 56a7f3bff4
commit 969767cb13

View File

@ -476,6 +476,13 @@ nsContentSecurityManager::CheckChannel(nsIChannel* aChannel)
return NS_OK;
}
// Allow the load if TriggeringPrincipal is the SystemPrincipal which
// is e.g. necessary to allow user user stylesheets to load XBL from
// external files.
if (nsContentUtils::IsSystemPrincipal(loadInfo->TriggeringPrincipal())) {
return NS_OK;
}
// if none of the REQUIRE_SAME_ORIGIN flags are set, then SOP does not apply
if ((securityMode == nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS) ||
(securityMode == nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED)) {