HexBrain

Brave Software · Report #1436558

Universal XSS with Playlist feature

Validstatus
highseverity
27upvotes
22 Jun 2023disclosed

How it was found

Summary:

Brave iOS has three weaknesses described below. By combining them, Universal XSS can be achieved.

  1. Exposure of UserScriptManager.securityToken Playlist.js embeds the exact value of the $<notifyNode> into HTMLVideoElement.prototype.setAttribute. By reading the value, an attacker can retrieve the hidden security token.

  2. Exposure of UserScriptManager.messageHandlerToken Also, WindowRenderHelper.js embeds the exact value of the $<handler> into W{securityToken}.postMessage. By reading the value, an attacker can retrieve the hidden message handler token.

  3. UXSS in PlaylistHelper through nodeTag PlaylistHelper.swift concatenates strings to build a JavaScript code and executes it on the mainframe of a WebView. Then, nodeTag given from a webpage is directly included in the code. So, if the nodeTag, named as tagId in JS world, passed from the page contained ');alert(document.location);//, unintended alert() is executed on the mainframe.

Products affected:

  • Brave iOS 1.32.3 and higher (include the latest Nightly)

Steps To Reproduce:

Supporting Material/References:

  • Demonstration movie is attached

Impact

  • Universal XSS on the arbitrary domains

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original