Bug 329869 - Dynamically loaded scripts don't degrade security state, r=honzab,kaie

This commit is contained in:
Honza Bambas 2009-08-25 21:25:32 +02:00
parent b8b02603b9
commit 9802042744
3 changed files with 15 additions and 4 deletions

View File

@ -1094,9 +1094,20 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
prevContentSecurity->SetCountSubRequestsBrokenSecurity(saveSubBroken);
prevContentSecurity->SetCountSubRequestsNoSecurity(saveSubNo);
}
PRBool retrieveAssociatedState = PR_FALSE;
if (securityInfo &&
(aProgressStateFlags & nsIWebProgressListener::STATE_RESTORING) != 0)
(aProgressStateFlags & nsIWebProgressListener::STATE_RESTORING) != 0) {
retrieveAssociatedState = PR_TRUE;
} else {
nsCOMPtr<nsIWyciwygChannel> wyciwygRequest(do_QueryInterface(aRequest));
if (wyciwygRequest) {
retrieveAssociatedState = PR_TRUE;
}
}
if (retrieveAssociatedState)
{
// When restoring from bfcache, we will not get events for the
// page's sub elements, so let's load the state of sub elements

View File

@ -66,6 +66,7 @@ _TEST_FILES = \
moonsurface.jpg \
redirecttoemptyimage.sjs \
somestyle.css \
test_bug329869.html \
test_bug383369.html \
test_bug455367.html \
test_bug472986.html \
@ -97,7 +98,6 @@ _TEST_FILES = \
unsecurePictureDup.html \
$(NULL)
# test_bug329869.html \ leaks, bug 452401
# test_dynUnsecureRedirect.html \ intermitently fails, quit often, bug 487402
# test_unsecureIframeMetaRedirect.html \ also intermittently fails, less often, bug 487632

View File

@ -1,3 +1,3 @@
document.write("This is insecure XSS script " + document.cookie);
todoSecurityState("broken", "security broken after document write from unsecure script");
isSecurityState("broken", "security broken after document write from unsecure script");
finish();