Bug 1359204 - Do not query nested URI within CheckChannel in ContentSecurityManager

This commit is contained in:
janekptacijarabaci 2018-04-30 23:53:22 +02:00 committed by Roy Tam
commit 69c0760b8b

View file

@ -12,7 +12,6 @@
#include "nsMixedContentBlocker.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "nsINestedURI.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabChild.h"
@ -657,12 +656,6 @@ nsContentSecurityManager::CheckChannel(nsIChannel* aChannel)
if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) {
// query the nested URI for security checks like in the case of view-source
nsCOMPtr<nsINestedURI> nestedURI = do_QueryInterface(uri);
if (nestedURI) {
nestedURI->GetInnerURI(getter_AddRefs(uri));
}
// TYPE_DOCUMENT and TYPE_SUBDOCUMENT loads might potentially
// be wyciwyg:// channels. Let's fix up the URI so we can
// perform proper security checks.