New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 653610 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Security



Sign in to add a comment

Security: Internal functions leaked when DevTools is open

Reported by pim...@live.nl, Oct 6 2016

Issue description

VULNERABILITY DETAILS
If DevTools is open, then a script [1] is run in the context of the webpage. The script has some cases of `__proto__: null`, presumably to prevent accessors on `Object.prototype` from messing with the objects in there. However, the assignment `InjectedScript.primitiveTypes = ...` *is* interceptable, and the entire `InjectedScript` function is thereby leaked to the webpage.

Of particular interest is the `InjectedScript.RemoteObject.prototype._generatePreview` function. This calls the native function `InjectedScriptHost.getInternalProperties`. Its return value can be intercepted by overwriting `_appendPropertyDescriptors`. What is interesting is that the return value contains `Scope` objects. These are objects that map variable names to objects that are in scope of a given function. This can be used to obtain non-exposed variables in a script.

In particular, using some tricks it is possible to run a function that requires a user gesture without a user gesture, like I did in  issue 468931 . (That issue has been fixed, but using this vulnerability that particular exploit can still be done if DevTools is open.)

The details: Using `getInternalProperties`, we can get `Event` in `webstore_custom_bindings.js`, a script used in the extension system but run for regular webpages. In turn, we can get `$Function` since it is in scope of `Event` in `event.js`. Overwriting `$Function.bind`, we can intercept a function defined in `bindings.js`. That function has `require` in scope, which can be used to obtain `getFileBindingsForApi` in `file_entry_binding_util.js`. This function has `GetModuleSystem` in scope, which can be used to obtain `requireNative`. Finally, this can be used to obtain `RunWithGesture` in the `guest_view_internal` native module.

VERSION
Chrome Version: 55.0.2881.5 canary (64-bit). It does not reproduce in stable. I did not try beta/dev.
Operating System: Windows 10

REPRODUCTION CASE
See attachment. It is a bit dirty so as to trigger certain codepaths. Note that it only reproduces when DevTools is open.

 [1] https://chromium.googlesource.com/v8/v8/+/master/src/inspector/injected-script-source.js

 
bug.html
2.1 KB View Download
Components: Platform>DevTools>Platform
Labels: M-54 Security_Severity-High Security_Impact-Beta Pri-1
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: OS-All
Cc: dgozman@chromium.org
Owner: kozyatinskiy@chromium.org
Not sure whether this actually works in M54 (beta).
Status: Started (was: Assigned)
Beta is affected, fix is on the way: https://codereview.chromium.org/2399003003/
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 7 2016

Labels: ReleaseBlock-Stable
Labels: Merge-Request-54
Status: Fixed (was: Started)
Labels: -Merge-Request-54 Merge-Approved-54
Approved for M54
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 8 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c020bb514eecc71682d2d50110e5512b29f72f17

commit c020bb514eecc71682d2d50110e5512b29f72f17
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Sat Oct 08 01:03:49 2016

[DevTools] filter useless in preview internal properties

Only subset of internal properties can be useful in preview, report only them.

BUG= chromium:653610 
TBR=dgozman@chromium.org

Review URL: https://codereview.chromium.org/2403643002 .

Committed: https://crrev.com/fac3b6fa46b29142eafbb0060bcc4ffbe78c4cc4
Cr-Original-Commit-Position: refs/heads/master@{#40064}
Cr-Commit-Position: refs/branch-heads/2840@{#692}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/c020bb514eecc71682d2d50110e5512b29f72f17/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Project Member

Comment 10 by sheriffbot@chromium.org, Oct 8 2016

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: -ReleaseBlock-Stable
Labels: reward-topanel
Labels: -reward-topanel reward-unpaid reward-1000
Labels: -Security_Severity-High Security_Severity-Medium
Congratulations, the panel awarded $1,000 for this bug!
Labels: reward-inprocess
Labels: -reward-unpaid
Project Member

Comment 17 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c020bb514eecc71682d2d50110e5512b29f72f17

commit c020bb514eecc71682d2d50110e5512b29f72f17
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Sat Oct 08 01:03:49 2016

[DevTools] filter useless in preview internal properties

Only subset of internal properties can be useful in preview, report only them.

BUG= chromium:653610 
TBR=dgozman@chromium.org

Review URL: https://codereview.chromium.org/2403643002 .

Committed: https://crrev.com/fac3b6fa46b29142eafbb0060bcc4ffbe78c4cc4
Cr-Original-Commit-Position: refs/heads/master@{#40064}
Cr-Commit-Position: refs/branch-heads/2840@{#692}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/c020bb514eecc71682d2d50110e5512b29f72f17/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Project Member

Comment 18 by sheriffbot@chromium.org, Jan 14 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment