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

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

Issue 2730383002: Don't allow GuestView JS objects to inherit global prototype. (Closed)
Patch Set: 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
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/guest_view/guest_view_container.js
diff --git a/extensions/renderer/resources/guest_view/guest_view_container.js b/extensions/renderer/resources/guest_view/guest_view_container.js
index 8cfc8cb441afa19109e320c0a6405f79e9878a85..efec02adb3a64303096e849bd0ec5888fa71499a 100644
--- a/extensions/renderer/resources/guest_view/guest_view_container.js
+++ b/extensions/renderer/resources/guest_view/guest_view_container.js
@@ -31,6 +31,10 @@ function GuestViewContainer(element, viewType) {
GuestViewInternalNatives.RegisterView(this.viewInstanceId, this, viewType);
}
+// Prevent GuestViewContainer inadvertently inheriting code from the global
+// Object, allowing a pathway for executing unintended user code execution.
+GuestViewContainer.prototype.__proto__ = null;
+
// Forward public API methods from |proto| to their internal implementations.
GuestViewContainer.forwardApiMethods = function(proto, apiMethods) {
var createProtoHandler = function(m) {
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698