CEF remote debugging is vulnerable to dns rebinding attack #14149
Comments
Thanks for reporting @ChiChou! We will have a look at it. |
@ChiChou I am currently looking at this. I am not able to replicate the behavior. Tried setting up a domain with port configured to 9234 but the the Note: I have setup a sample HTTP server with port configured to 9234, and accessing the same in the browser using direct IP. |
I've already setup the domain here: The dns server needs to response different ip addresses on each request: 127.0.0.1 and the attacker ip VSCode (actually all electron based app) and node.js also suffers from this sort of attack, and they have already fixed this: |
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V8.md
The node.js patch: |
I would like to start a conversation with you regarding this. Can you send a mail to prashant at adobe dot com. |
🍻Good Job |
Prerequisites
Debug -> Reload Without Extensions
?Description
Brackets listen on port 9234 to enable CEF remote debug, which based on DevTool protocol:
The
webSocketDebuggerUrl
can be access from other domains, but we need to get the id first which does not support CORS.@taviso has recently published some bugs that exploit dns-rebinding to bypass same origin policy and interact with http servers on localhost. I set up a dns-rebinding attack domain and test page based on his work: http://2d201a44.7f000001.rbndr.us:9234
Now the attacker is able to manipulate Bracket's frontend. But I can't directly evaluate javascript in the context with Runtime.Evaluate command, which I believe is a bug from Chromium: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1238
Luckily DOM manipulation still work. So I use
DOM.setOuterHTML
to add my scripts.In this javascript context, I am able to abuse some global object like
brackets.fs
andbrackets.app
to archive native code execution. Now the evil website can compromise users' computer if brackets is running.Steps to Reproduce
http://evildomain:9234
Reproduced on macOS High Sierra 10.13.3 (17D102) and Safari Version 11.0.3 (13604.5.6). Will also work on Windows and other modern browsers.
Expected behavior:
The page prints the WebSocket debugger url and Calculator app shows up, which means native code execution.
Actual behavior:
The first time victim open the page it resolves to attacker's server. After few minutes the TTL has expired and the page is able to bypass same origin policy, and the WebSocket url is read. Use DevTools protocol to inject arbitrary javascript to Brackets. Abuse the native api to execute system command.
Versions
The text was updated successfully, but these errors were encountered: