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

Unified Diff: WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

Issue 3452011: Merge 67509 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
===================================================================
--- WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (revision 67717)
+++ WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (working copy)
@@ -605,10 +605,12 @@
if (key->IsString()) {
String name = toWebCoreString(key);
-
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(name))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(name))
return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(name) && !host->HasRealNamedProperty(key->ToString()))
+ return true;
}
return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, false);
@@ -628,9 +630,12 @@
if (!target)
return false;
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(index))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(index))
return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(index) && !host->HasRealIndexedProperty(index))
+ return true;
return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, false);
}
« no previous file with comments | « LayoutTests/http/tests/security/xss-DENIED-frame-name-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698