Commit d78287db authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

BB 44865: Block requests to chrome://*/locale.

parent bdc5bd2a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,12 @@ nsresult nsScriptSecurityManager::CheckLoadURIFlags(
          return NS_OK;
        }
      } else if (targetScheme.EqualsLiteral("chrome")) {
        nsAutoCString path;
        if (NS_SUCCEEDED(aTargetURI->GetPathQueryRef(path)) &&
            StringBeginsWith(path, "/locale/"_ns)) {
          return NS_ERROR_DOM_BAD_URI;
        }

        // Allow the load only if the chrome package is allowlisted.
        nsCOMPtr<nsIXULChromeRegistry> reg(
            do_GetService(NS_CHROMEREGISTRY_CONTRACTID));