Bug 1595762: Make type object loads subject to CSP frame ancestors. r=jkt,annevk
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Wed, 13 Nov 2019 14:52:55 +0000
changeset 501806 da9476881d622b2d519f589f39d586f974ddb1e1
parent 501805 e7a759d68461596d4988c54e8c8e23b9a853e6ae
child 501807 87336cc7f8a1afe7dbd042fd23de5ae3010b0845
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjkt, annevk
bugs1595762
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1595762: Make type object loads subject to CSP frame ancestors. r=jkt,annevk Differential Revision: https://phabricator.services.mozilla.com/D52806
dom/security/DOMSecurityManager.cpp
--- a/dom/security/DOMSecurityManager.cpp
+++ b/dom/security/DOMSecurityManager.cpp
@@ -116,19 +116,20 @@ nsresult DOMSecurityManager::ParseCSPAnd
   }
 
   if (!httpChannel) {
     return NS_OK;
   }
 
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
   nsContentPolicyType contentType = loadInfo->GetExternalContentPolicyType();
-  // frame-ancestor check only makes sense for subdocument loads, if this is
-  // not a load of such type, there is nothing to do here.
-  if (contentType != nsIContentPolicy::TYPE_SUBDOCUMENT) {
+  // frame-ancestor check only makes sense for subdocument and object loads,
+  // if this is not a load of such type, there is nothing to do here.
+  if (contentType != nsIContentPolicy::TYPE_SUBDOCUMENT &&
+      contentType != nsIContentPolicy::TYPE_OBJECT) {
     return NS_OK;
   }
 
   nsAutoCString tCspHeaderValue, tCspROHeaderValue;
 
   Unused << httpChannel->GetResponseHeader(
       NS_LITERAL_CSTRING("content-security-policy"), tCspHeaderValue);