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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2707113005: The security check in document.write should test for same-origin (Closed)
Patch Set: updates Created 3 years, 10 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: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 44883d53f5a70fb724fe4faad6350134fb4342b3..00416e2f888b7682e9a0ea26e32ff6ecff4081ed 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3159,7 +3159,8 @@ void Document::write(const SegmentedString& text,
}
if (enteredDocument &&
- !getSecurityOrigin()->canAccess(enteredDocument->getSecurityOrigin())) {
+ !getSecurityOrigin()->isSameSchemeHostPortAndSuborigin(
+ enteredDocument->getSecurityOrigin())) {
exceptionState.throwSecurityError(
"Can only call write() on same-origin documents.");
return;

Powered by Google App Engine
This is Rietveld 408576698