Bug 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 21 Dec 2017 10:54:43 -0500
changeset 448973 beb46b2f38d48591d907d5823b95c492fa36f89a
parent 448972 950d56123c676ddb5f1630aba0e1fb78451eba97
child 448974 d3f2ca3a3efeb6771fcbdb24d0d4cc30b63038b3
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1424474
milestone59.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 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs MozReview-Commit-ID: I3DyrYGpGC2
caps/nsScriptSecurityManager.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -892,17 +892,17 @@ nsScriptSecurityManager::CheckLoadURIFla
                     return NS_ERROR_DOM_BAD_URI;
                 }
 
                 bool accessAllowed = false;
                 rph->AllowContentToAccess(aTargetBaseURI, &accessAllowed);
                 if (accessAllowed) {
                     return NS_OK;
                 }
-            } else {
+            } else if (targetScheme.EqualsLiteral("chrome")) {
                 // Allow the load only if the chrome package is whitelisted.
                 nsCOMPtr<nsIXULChromeRegistry> reg(
                         do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
                 if (reg) {
                     bool accessAllowed = false;
                     reg->AllowContentToAccess(aTargetBaseURI, &accessAllowed);
                     if (accessAllowed) {
                         return NS_OK;