New issue
Advanced search Search tips

Issue 618333 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Security



Sign in to add a comment

Security: Parameter sanitization failure in DevTools leads to privileged script execution

Reported by gregory....@gmail.com, Jun 8 2016

Issue description

VULNERABILITY DETAILS
Same vulnerability as  Issue 607939 . Fix for it is insufficient as it checks only if "remoteFrontendUrl" starts with "https://chrome-devtools-frontend.appspot.com/" but fails to sanitize any data that follows it. Since the remoteFrontendUrl is decoded in the remote frontend page before the iframe src's is written via document.write(), arbitrary html tags can be injected into the page.

Example Simple URL that shows alert if XSS-Auditor is disabled (via cmdline):
chrome-devtools://devtools/remote/serve_rev/@199588/devtools.html?remoteFrontendUrl=https://chrome-devtools-frontend.appspot.com/%27%3E%3C/iframe%3E%3Ciframe%20src=%27javascript:alert(document.domain)

I was able to achieve XSS-Auditor bypass for that page by splitting the JS snippet [executed via onerror event on an img tag] across two parameters.

Format for URL:
chrome-devtools://devtools/remote/serve_rev/@199588/devtools.html?[JSSNIP2]=0&remoteFrontendUrl=https://chrome-devtools-frontend.appspot.com/%27%3E%3C/iframe%3E%3Cimg%20src=x%20onerror=%27javascript:[JSSNIP1]

(Working PoC URL is attached).

VERSION
Chrome Version: 51.0.2704.84 m + stable
Operating System: All

REPRODUCTION CASE
Copy-paste the full URL from the attached Devtools-Crafted-URI2.txt into Chrome omnibox.
For demo purposes, it displays the content of C:\ drive

SUGGESTED FIX
In addition to existing check, It should check for quote character required for injection in the remoteFrontendUrl param data. Attached modified function [sanitizeRemoteFrontendUrl()] as a suggested patch.
 
Devtools-Crafted-URI2.txt
1.7 KB View Download
SuggestedPatchFunction.txt
546 bytes View Download
Cc: dgozman@chromium.org
Components: Platform>DevTools>Platform
I can't repro this: When I load this into omnibox (on Mac M51), the spinner just spins but with no other events.
Please try it with Windows system. The Repro case is for Windows OS; but the vulnerability should affected all OS.
Cc: -dgozman@chromium.org rdevlin....@chromium.org mea...@chromium.org
Labels: Security_Impact-Stable
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
I was able to repro on Win M51 -- it effectively outputs the dir listing of C:\. 

meacer-- Is it correct that extensions can navigate to chrome-devtool:// URLs? And if so, could they then read the contents of the page?

Comment 5 by mea...@chromium.org, Jun 10 2016

Labels: Security_Severity-Medium OS-Chrome OS-Linux OS-Mac OS-Windows Pri-1
> meacer-- Is it correct that extensions can navigate to chrome-devtool:// URLs? And if so, could they then read the contents of the page?

They can navigate to chrome-devtool:// URLs but shouldn't be able to read page contents.

I think this bug is medium severity given that it needs an extension install (mitigating factor), similar to  bug 607939 .
Labels: M-53
Labels: -M-53 M-52
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 20 2016

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

commit 554517a4587bfb0071bcd3c7eff6645a0b06d72a
Author: dgozman <dgozman@chromium.org>
Date: Mon Jun 20 20:33:22 2016

[DevTools] Whitelist remoteFrontendUrl and remoteBase params.

This also fixes loadScriptsPromise to not normalize hostname.

BUG= 619414 , 618333 

Review-Url: https://codereview.chromium.org/2065823004
Cr-Commit-Position: refs/heads/master@{#400768}

[modify] https://crrev.com/554517a4587bfb0071bcd3c7eff6645a0b06d72a/third_party/WebKit/Source/devtools/front_end/Runtime.js
[modify] https://crrev.com/554517a4587bfb0071bcd3c7eff6645a0b06d72a/third_party/WebKit/Source/devtools/front_end/devtools.js

Project Member

Comment 9 by sheriffbot@chromium.org, Jun 23 2016

dgozman: Uh oh! This issue still open and hasn't been updated in the last 14 days. This is a serious vulnerability, and we want to ensure that there's progress. Could you please leave an update with the current status and any potential blockers?

If you're not the right owner for this issue, could you please remove yourself as soon as possible or help us find the right one?

If the issue is fixed or you can't reproduce it, please close the bug. If you've started working on a fix, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Fixed (was: Assigned)
Project Member

Comment 11 by sheriffbot@chromium.org, Jun 29 2016

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
FYI - One more Attack vector (besides malicious extension; copy-pasting URLs) is by sending a crafted chrome-devtools link via "Google Tone" extension. The extension allows sending URLs of any schemes to nearby machines.
Labels: reward-topanel
Labels: -M-52 M-53
Project Member

Comment 15 by sheriffbot@chromium.org, Jul 21 2016

Labels: Merge-Request-53
Cc: awhalley@chromium.org
+awhalley@ whether to take this merge in for M53 Dev release on Tuesday (07/26).
Labels: -Merge-Request-53
The fix has landed as r400768, which is way before M53 was branched (r403382).
Project Member

Comment 18 by bugdroid1@chromium.org, Jul 23 2016

Labels: merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2f0798392134f38c8c68a7911ab622dc128775e3

commit 2f0798392134f38c8c68a7911ab622dc128775e3
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Sat Jul 23 00:31:46 2016

Merge to 2743 "[DevTools] Whitelist remoteFrontendUrl and remoteBase params."
> [DevTools] Whitelist remoteFrontendUrl and remoteBase params.
>
> This also fixes loadScriptsPromise to not normalize hostname.
>
> BUG= 619414 , 618333 
>
> Review-Url: https://codereview.chromium.org/2065823004
> Cr-Commit-Position: refs/heads/master@{#400768}
(cherry picked from commit 554517a4587bfb0071bcd3c7eff6645a0b06d72a)
TBR=pfeldman

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

Cr-Commit-Position: refs/branch-heads/2743@{#694}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/2f0798392134f38c8c68a7911ab622dc128775e3/third_party/WebKit/Source/devtools/front_end/Runtime.js
[modify] https://crrev.com/2f0798392134f38c8c68a7911ab622dc128775e3/third_party/WebKit/Source/devtools/front_end/devtools.js

Comment 19 Deleted

Labels: -Release-0-M52 Release-1-M52
Labels: -reward-topanel reward-unpaid reward-1000
Thanks - $1,000 for this one.
Labels: CVE-2016-5144
Labels: -reward-unpaid reward-inprocess
Labels: reward-topanel
Labels: -reward-topanel
Labels: -Reward-1000 reward-2000
Updating reward amount.
Project Member

Comment 28 by sheriffbot@chromium.org, Oct 5 2016

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
Labels: CVE_description-submitted

Sign in to add a comment