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

Unified Diff: extensions/renderer/resources/guest_view/guest_view_attributes.js

Issue 2745173002: Set prototype for GuestView*.prototype to null. (Closed)
Patch Set: More nulls. Created 3 years, 9 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: extensions/renderer/resources/guest_view/guest_view_attributes.js
diff --git a/extensions/renderer/resources/guest_view/guest_view_attributes.js b/extensions/renderer/resources/guest_view/guest_view_attributes.js
index 6c7f711ef6ce837814b16508c4a81581f41fa746..578e00e87cb17f24d0bac750003d30642a14f083 100644
--- a/extensions/renderer/resources/guest_view/guest_view_attributes.js
+++ b/extensions/renderer/resources/guest_view/guest_view_attributes.js
@@ -17,6 +17,12 @@ function Attribute(name, view) {
this.defineProperty();
}
+// Prevent GuestViewEvents inadvertently inheritng code from the global Object,
+// allowing a pathway for unintended execution of user code.
+// TODO(wjmaclean): Use utils.expose() here instead, track down other issues
+// of Object inheritance. https://crbug.com/701034
+Attribute.prototype.__proto__ = null;
+
// Retrieves and returns the attribute's value.
Attribute.prototype.getValue = function() {
return this.view.element.getAttribute(this.name) || '';

Powered by Google App Engine
This is Rietveld 408576698