Skip to content
XSS Disclosed report Intermediate

HTML injection in title of reader view

Brave's reader mode fails to escape HTML tags in the page title, allowing an attacker to inject arbitrary HTML into the reader view. This can be used to display a fake login form that steals credentials or to exfiltrate the original page content via a form submission.

nishimunea Follow

Originally disclosed on HackerOne

Medium 6.4 View original
  • Disclosed after 2.7 years

Summary:

Reader.html in Brave doesn't escape/trim HTML tags in %READER-TITLE%. https://github.com/brave/brave-ios/blob/development/Client/Frontend/Reader/Reader.html#L17 This allows any page to inject malicious HTML code in reader-mode page through <title>{html code you want to inject}</title>.

Products affected:

Brave iOS Version 1.20 (20.09.11.20), also current Nightly

Steps To Reproduce:

Supporting Material/References:

  • See attached movie file for the demonstration

Impact

Malicious web contents can inject HTML code and manipulate readerized page (hosted in localhost:65XX).

Also, if injected HTML code contains a string %READER-CONTENT%, it is replaced to the original page contents. https://github.com/brave/brave-ios/blob/87af4cbf0474bafd13673690aeee0c11059fbba2/Client/Frontend/Reader/ReaderModeUtils.swift#L29

So, attacker can steal user's sensitive information contained in the original HTML page through <form><textarea>%READER-CONTENT%</textarea>. When you open the following Google search link in reader-mode, you can reproduce the above scenario as well. https://www.google.com/search?q=%3Cform%3E%3Ctextarea%20name%3D%22dom%22%3E%25READER-CONTENT%25%3C%2Ftextarea%3E%3Cinput%20type%3D%22submit%22%3E%3C%2Fform%3E

Attachments

reader_injection.mov 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

Impact

An attacker could steal user credentials via a fake login form and could also exfiltrate sensitive information from the original page by injecting a form that includes the page content placeholder.

What the attacker needed

Victim uses Brave on iOS; victim opens a malicious page; victim activates reader mode

How it was found

  1. Open the provided Google Docs link in Brave on iOS.
  2. Tap the reader-mode button in the address bar.
  3. Observe that a malicious login form is rendered instead of the document.
  4. Fill the form; the entered username and password are sent to a malicious website.

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.

Reader mode is a feature that strips away clutter from web pages. Brave's reader mode did not properly clean the page title, so a malicious page could include HTML code in its title. When a user opened that page in reader mode, the code ran and could show a fake login form or steal information from the page.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.