Bug 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs a=gchang
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 21 Dec 2017 10:54:43 -0500
changeset 445565 c09a1e918065e66d8cd5182c7e7d63cba0a77d45
parent 445564 7640a0204f44274514f7bc833cf9e17ac02c2b92
child 445566 616b88ee8976d05a82c6a6c8bbf47c3444f67e52
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, gchang
bugs1424474
milestone58.0
Bug 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs a=gchang MozReview-Commit-ID: I3DyrYGpGC2
caps/nsScriptSecurityManager.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -889,17 +889,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;