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

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 18865003: Do not allow HTTP refresh headers to refresh to javascript: URLs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index cf14b35d122851d3947b1f44e8e8d29dd3bc2eda..c68edaa75a1c70f0d20f0ecafb9da94a4c39a8b7 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -538,7 +538,12 @@ void FrameLoader::receivedFirstData()
else
url = m_frame->document()->completeURL(url).string();
- m_frame->navigationScheduler()->scheduleRedirect(delay, url);
+ if (!protocolIsJavaScript(url)) {
+ m_frame->navigationScheduler()->scheduleRedirect(delay, url);
+ } else {
+ String message = "Refused to refresh " + m_frame->document()->url().elidedString() + " to a javascript: URL";
+ m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message);
+ }
}
void FrameLoader::setOutgoingReferrer(const KURL& url)
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698