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

Unified Diff: Source/core/dom/Document.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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 9120562dece95b5b5ba7393616666088bd5101a2..8be59708ec297caf360e3ff7c26939cff00c58bb 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2748,7 +2748,12 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
url = m_url.string();
else
url = completeURL(url).string();
- frame->navigationScheduler()->scheduleRedirect(delay, url);
+ if (!protocolIsJavaScript(url)) {
+ frame->navigationScheduler()->scheduleRedirect(delay, url);
+ } else {
+ String message = "Refused to refresh " + m_url.elidedString() + " to a javascript: URL";
+ addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message);
+ }
}
} else if (equalIgnoringCase(equiv, "set-cookie")) {
// FIXME: make setCookie work on XML documents too; e.g. in case of <html:meta .....>
« no previous file with comments | « LayoutTests/http/tests/security/no-javascript-refresh-static-expected.txt ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698