Skip to content

Commit f5c64cc

Browse files
committed
<third_party/WebKit> Cherry-pick fix for CVE-2015-6768
Block javascript: document navigations during page dismissal events. This basically reflects the logic from FrameLoader::startLoad. Before this patch, javascript: document navigations could be performed during page dismissal events. This could be problematic, especially that dismissal events prevent loaders from being stopped or detached. This patch adds a bail-out condition to FrameLoader::replaceDocumentWhileExecutingJavaScriptURL. BUG=556724 Review URL: https://codereview.chromium.org/1451123002 Change-Id: Ifcb3dfd1d962c3338a3703def3b84432b58cfa5b Reviewed-by: Michael Brüning <[email protected]>
1 parent 9e8b6a1 commit f5c64cc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

chromium/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ Mao Yujie <[email protected]>
288288
Mao Yujie <[email protected]>
289289
Marco Rodrigues <[email protected]>
290290
Mario Sanchez Prada <[email protected]>
291+
Mariusz Mlynski <[email protected]>
291292
Mark Hahnenberg <[email protected]>
292293
Mark Seaborn <[email protected]>
293294
Martin Bednorz <[email protected]>

chromium/third_party/WebKit/Source/core/loader/FrameLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void FrameLoader::clear()
286286
// This is the <iframe src="javascript:'html'"> case.
287287
void FrameLoader::replaceDocumentWhileExecutingJavaScriptURL(const String& source, Document* ownerDocument)
288288
{
289-
if (!m_frame->document()->loader())
289+
if (!m_frame->document()->loader() || m_frame->document()->pageDismissalEventBeingDispatched() != Document::NoDismissal)
290290
return;
291291

292292
// DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL can cause the DocumentLoader to get deref'ed and possible destroyed,

0 commit comments

Comments
 (0)