`chrome://brave` available for navigation in Release build [-> RCE] + navigation to `chrome://*` using tab_helper ["Open in new tab"]
Brave browser allowed navigation to the internal chrome://brave origin from a local HTML file, which then loaded with access to private Muon APIs. An attacker could use these APIs to execute arbitrary code on the device, such as launching Calculator.app.
- Triaged in 17 hours
- Fixed in 20 days
- Paid in 20 days
- Disclosed after 40 days
Summary:
chrome://brave is available for navigation
Navigation to chrome://brave + <local_file_path> requires local file at <local_file_path>.
The file loaded in this context has access to private Muon APIs such as chrome.ipcRenderer/remote/webFrame/webViewRequest.
Muon API allows executing code on the device. (e.g. with chrome.remote.require('child_process').exec)
In addition, Brave isn't sandboxed (on all OS).
That's clearly a vulnerability, not a feature:
- it's in Release channel, not in Debug builds
- Could lead to RCE
Note: attacker knows the correct
<local_file_path>after loading the file fromfile://origin (window.location.pathname).
Navigation to chrome://brave
I've already shown the way to navigate to file:// URLs in #369218, which was fixed in 0.23.80.
I mentioned in the report that it's possible navigating to
chrome://URLs too in #369218. However, the fix was incomplete. It only works forabout:andfile:URLs.
PoC
- Shows that
<webview>works - Launches
Calculator.appon macOS
Products affected:
Brave: 0.23.79 (0.23.80 and 0.23.100 too, where #369218 is patched) V8: 6.8.275.24 rev: 51b49051a779f0db94fbcfd0df5faca781299ea0 Muon: 8.0.7 OS Release: 17.7.0 Update Channel: Release OS Architecture: x64 OS Platform: macOS Node.js: 7.9.0 Brave Sync: v1.4.2 libchromiumcontent: 68.0.3440.84
Steps To Reproduce || Attack Scenario:
- Download
exploit.html - Open link in the file using "Open in new tab"
- The new tab opens with private
<webview>tag +Calculator.appstarts
Patch
Preventing navigation to chrome://brave origin seems ok.
Additional resources
Screencast attached.
Impact
Crafted HTML file allows executing code on the device.
Requires user gesture - "Open in a new tab". Set impact to "High", because requires downloading the file.
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the fix for a previous navigation issue only blocked about: and file: URLs, leaving chrome:// URLs reachable, and the chrome://brave page then exposed privileged APIs to the loaded content.
Impact
Crafted HTML file allows executing code on the device, but requires a user gesture ('Open in a new tab') and downloading the file.
What the attacker needed
Victim downloads a malicious HTML file; victim chooses 'Open in new tab'
The fix
Preventing navigation to the chrome://brave origin was suggested as a fix.
How it was found
- Download the exploit HTML file.
- Open the link in the file using 'Open in new tab'.
- The new tab opens with a private webview tag and Calculator.app starts.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A web browser has special internal pages (like chrome://brave) that normal websites should not be able to open. This report shows that a malicious local file could trick the browser into opening that internal page, and from there run programs on the computer. The attacker needs the victim to download a file and choose 'Open in new tab'.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.