Local files reading from the "file://" origin through `brave://`
A fix that blocked reading local files from web pages did not cover the brave:// scheme, so a page loaded from the file:// origin could import a brave:// URL and read local files. An attacker could use this to read files on the device, such as the system password file.
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 56 days
Summary:
Sadly, fix for #390013 works only for web. Loading brave:// from the file:// origin allows reading local files on the device.
I said that fix could be insufficient 😈
file:// and brave:// both are local origins. That means it's possible to access brave:// from file:// and vice versa.
Products affected:
Brave: 0.23.77 V8: 6.8.275.24 rev: 0125b5f5ddc7eebc832ceeb4f4275230ec49d149 Muon: 8.0.6 OS Release: 17.7.0 Update Channel: Релиз OS Architecture: x64 OS Platform: macOS Node.js: 7.9.0 Brave Sync: v1.4.2 libchromiumcontent: 68.0.3440.84
Steps To Reproduce:
<head>
<script>
function show() {
var file = link.import.querySelector('body')
alert(file.innerHTML)
}
</script>
<link id="link" href="brave:///etc/passwd" rel="import" as="document" onload="show()" />
</head>
Supporting Material/References:
Screencast + PoC attached.
Impact
Local files reading should be denied.
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 earlier fix only blocked access from web origins and did not treat the file:// origin as equally untrusted when loading brave:// resources.
Impact
A page from the file:// origin could read local files on the device, which should be denied.
What the attacker needed
Victim opens a local HTML file
The fix
The browser should block brave:// resources from being loaded by file:// pages, extending the earlier fix to local origins.
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.
Browsers have internal pages, here called brave://, meant to be off-limits to ordinary web content. The report shows a page opened from a local file could still pull in one of those internal pages and display its contents, meaning a malicious local page could peek at files on the computer.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.