Brave Software · Report #1436558
Universal XSS with Playlist feature
How it was found
Summary:
Brave iOS has three weaknesses described below. By combining them, Universal XSS can be achieved.
-
Exposure of UserScriptManager.securityToken Playlist.js embeds the exact value of the
$<notifyNode>intoHTMLVideoElement.prototype.setAttribute. By reading the value, an attacker can retrieve the hidden security token. -
Exposure of UserScriptManager.messageHandlerToken Also, WindowRenderHelper.js embeds the exact value of the
$<handler>intoW{securityToken}.postMessage. By reading the value, an attacker can retrieve the hidden message handler token. -
UXSS in PlaylistHelper through nodeTag PlaylistHelper.swift concatenates strings to build a JavaScript code and executes it on the mainframe of a WebView. Then,
nodeTaggiven from a webpage is directly included in the code. So, if thenodeTag, named astagIdin JS world, passed from the page contained');alert(document.location);//, unintendedalert()is executed on the mainframe.
Products affected:
- Brave iOS 1.32.3 and higher (include the latest Nightly)
Steps To Reproduce:
- Visit the Google page: https://sites.google.com/view/nishimunea-brave-uxss1/page
- This page contains a cross origin malicious page https://csrf.jp/brave/playlist.php in an iframe
- The iframe exploits the above three weaknesses to send a message to playlistHelper
- Push
Add to Brave PlaylistandOpenbutton in the setting menu - An alert dialog is appear on the sites.google.com
Supporting Material/References:
- Demonstration movie is attached
Impact
- Universal XSS on the arbitrary domains