Skip to content
Info disclosure Disclosed report Intermediate

Security token and handler name leak from window.braveBlockRequests

Brave for iOS sets a JavaScript property on the window object after page scripts run, allowing a malicious page to define it as non-configurable and intercept the secret handler name and security token.

nishimunea Follow

Originally disclosed on HackerOne

  • Disclosed after 10 months

Summary:

Brave for iOS protects privileged JS to native bridges by using random JavaScript handler names and security tokens. However, by altering window.braveBlockRequests property from scripts on the web page, these secret values can be stolen.

To be specific, braveBlockRequests property is set after the execution of the script on the page. Thus, by setting the malicious property as an immutable property from the page beforehand as shown below, it is possible to prevent overwriting by the legitimate property.

Object.defineProperty(window, "braveBlockRequests", {
    enumerable: false,
    configurable: false,
    writable: false,
    value: function(args) { window.args = args } // Steal handler name and token here
});

Products affected:

  • Brave for iOS Version 1.41.1 (22.7.27.20) with the default settings

Steps To Reproduce:

Supporting Material/References:

  • Attached is a movie file that demonstrate the above steps to reproduce.

Impact

The impact depends on which bridge is abused. As further features are implemented in the Brave, its potential risk tends to be increased.

Attachments

brave_token_leak.mp4 From the original on HackerOne

The original report as published on HackerOne, by nishimunea. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 script that sets window.braveBlockRequests runs after page scripts, so a page can predefine the property as non-configurable and capture the secret values when the legitimate script tries to assign them.

Impact

The impact depends on which bridge is abused; as more features are added, the potential risk could increase.

What the attacker needed

Victim uses Brave for iOS; victim visits a malicious page

How it was found

  1. Open the provided demonstration page.
  2. Press the Attack button.
  3. Observe the secret handler name and security token displayed on the page.

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.

Brave for iOS uses hidden JavaScript function names and secret tokens to let its own web pages talk safely to the app. A malicious website can trick the browser into revealing those secrets by locking the property before Brave sets it. With the secrets, an attacker might be able to use the app's internal features in unintended ways.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by nishimunea

View all

12 more disclosed reports, best first.

More from Brave Software

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.