New XSS vector in ReaderMode with %READER-TITLE-NONCE%
The ReaderMode HTML template inserts the page's author meta tag without escaping, and a relaxed CSP allows scripts with a nonce placeholder. An attacker can inject a script that executes in the ReaderMode origin, potentially stealing other ReaderMode pages and accessing privileged pages via the uuidkey.
Originally disclosed on HackerOne
- Disclosed after 18 months
Summary:
Previously, script execution in ReaderMode pages was prohibited by CSP. However, three months ago, this commit partially relaxed the CSP and scripts with nonce-%READER-TITLE-NONCE% are now allowed to be executed. This relaxation of the CSP rule can be exploited for XSS attacks on ReaderMode pages.
Here, the attack vector is %READER-CREDITS% which is also included in the ReaderMode HTML template. The %READER-CREDITS% is replaced with the value of the <meta name="author"> tag in the original page, but then the HTML tags are not escaped. So, when the following meta tag is embedded in the original page and the page is displayed in ReaderMode, this Swift code replaces %READER-TITLE-NONCE% with the correct nonce value.
<meta name="author" content="Evil <script nonce=%READER-TITLE-NONCE%>alert(document.location);</script>!--">
As a result, the malicious script will be executed on a page http://localhost:6571/reader-mode?uri={uri}&uuidkey={value}.
In Brave, all readalized pages are hosted on http://localhost:6571. Therefore, through this XSS, any cross-origin pages, that has been converted to ReaderMode, can be stolen by embedding an iframe and reading out them. Also, please find that the uuidkey is included in the URL query string. By obtaining this key, the attacker can gain access to Brave's privileged pages.
Products affected:
- Brave iOS 1.31.1 and higher (including the latest Nightly)
Steps To Reproduce:
- Show https://csrf.jp/2021/brave/author_xss.php
- Push reader mode button on the address bar
- An alert dialog is shown
Supporting Material/References:
- See the screenshot of the alert dialog when the bug is reproduced.
Impact
- Any cross-origin pages, that has been converted to ReaderMode, can be stolen
- Attacker can gain access to Brave's privileged pages
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
The author meta tag value is inserted into the ReaderMode HTML without escaping, and the CSP allows scripts with a nonce that is also inserted into the same template.
Impact
Any cross-origin page converted to ReaderMode could be stolen, and the attacker may gain access to Brave's privileged pages by obtaining the uuidkey.
What the attacker needed
Victim visits a malicious page; victim activates ReaderMode
How it was found
- Open the provided test page that contains a malicious author meta tag.
- Activate ReaderMode using the button in the address bar.
- Observe the alert dialog showing script execution.
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.
ReaderMode is a feature that shows a simplified version of a web page. The app builds this simplified page by inserting parts of the original page, like the author name, without cleaning them first. Because the app also allows scripts that carry a special secret code, an attacker can sneak in a script that runs as if it were part of the app, letting them read other pages or access private areas.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.