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

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

Issue 2502783004: Don't skip security checks for javascript: URLs when the JS stack is empty. (Closed)
Patch Set: Simplified. Created 4 years, 1 month 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/Source/bindings/core/v8/ScriptController.cpp ('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 5168a162275426a27313b095d744f7cc1b87cfc3..661d21e6e526c5c5b4d6b5ceaf684074a6b976b5 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -23,6 +23,7 @@
#include "core/html/HTMLFrameElementBase.h"
+#include "bindings/core/v8/BindingSecurity.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/ScriptEventListener.h"
#include "core/HTMLNames.h"
@@ -55,10 +56,14 @@ bool HTMLFrameElementBase::isURLAllowed() const {
const KURL& completeURL = document().completeURL(m_URL);
- if (protocolIsJavaScript(completeURL)) {
- if (contentFrame() &&
- !ScriptController::canAccessFromCurrentOrigin(toIsolate(&document()),
- contentFrame()))
+ if (contentFrame() && protocolIsJavaScript(completeURL)) {
haraken 2016/11/21 01:26:31 Add a comment and explain what these security chec
Mariusz Mlynski 2016/11/22 06:30:14 Done.
+ v8::Isolate* isolate = toIsolate(&document());
+ LocalDOMWindow* accessingWindow = isolate->InContext()
+ ? currentDOMWindow(isolate)
+ : document().domWindow();
+ if (!BindingSecurity::shouldAllowAccessToFrame(
+ accessingWindow, contentFrame(),
+ BindingSecurity::ErrorReportOption::Report))
return false;
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698