Xiaomi Execute Arbitrary JavaScript
The Xiaomi Browser's read mode failed to sanitise HTML taken from a page's title tag, so a crafted page could inject an iframe and run arbitrary JavaScript. An attacker could execute script in the browser's read mode context when the victim opened a malicious page and enabled read mode.
Published on nmochea.medium.com
Due to lack of HTML Sanitization, It’s possible to Inject Malicious Iframe tag in Readmode and Execute Arbitrary JavaScript code.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the title value was passed into the read-mode HTML without going through the sanitiser that other content used.
Impact
An attacker could run arbitrary JavaScript in the browser's read-mode context once the victim opened a crafted page and enabled read mode.
What the attacker needed
Victim opens a crafted page; victim enables read mode
The fix
The vulnerability was fixed according to the disclosure timeline.
How it was found
- Create a local HTML file containing the malicious iframe markup.
- Create a second page that sets the title to that markup and loads the first file.
- Serve both files from a local web server.
- Open the second page in the browser and turn on read mode.
- The script from the iframe runs as soon as read mode is enabled.
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 write-up has not been written yet. The Original tab links to the source.
Read mode is a browser feature that strips a web page down to just its article text. The browser took the page's title and inserted it into the read-mode page without cleaning it first, so hidden markup in the title could create an iframe that loads attacker script. That means a page you visit could run code inside the browser's own read-mode screen.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.