Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2154213003: Prevent 'javascript:' URL execution in sandboxed frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-javascript-url.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
index 5ad6f3a364b649147e4f84259d33fdde23f3c3fd..2ee42f3d64356790b065e25232b833ba4e7ad9f8 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -93,6 +93,8 @@ void HTMLFrameElementBase::openURL(bool replaceCurrentItem)
return;
if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame())
return;
+ if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin)
+ return;
toLocalFrame(contentFrame())->script().executeScriptIfJavaScriptURL(scriptURL);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-javascript-url.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698