Skip to content
XSS Write-up Intermediate

How Pwn2Own Was Almost Won Via XSS

The Android web market stored an app's description field without sanitising it, so a submitted script ran in the browser of anyone who viewed the app page, search results or developer page. Because the market could push app installs to a linked phone without a confirmation prompt, that script could silently install an app with any permissions and then trigger it to run.

jon.oberheide.org

Published on jon.oberheide.org

The actual vulnerability was an incredibly low-hanging naive persistent XSS in the Android web market. When posting an Android application through the publishing interface, there’s a description field for you to describe your application:

Jon Oberheide, on jon.oberheide.org

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 app description field was stored and later rendered into market pages without output encoding, allowing stored script to run in the viewer's browser.

Impact

An attacker could silently install an app with any permissions on a victim's phone and get it to run, though the victim had to be logged in to their Google account and the issue was fixed after disclosure.

What the attacker needed

Victim logged in to a Google account; victim opens a market page with the payload; attacker can publish an app

The fix

Google rolled out a fix, and the author argues an on-device confirmation prompt should also be added for server-initiated installs.

How it was found

  1. Publish an app through the market's publishing interface and put a script in the description field.
  2. Have a victim who is logged in to their Google account open a market page that shows the description.
  3. The script runs and sends a request to the install endpoint to push an attacker app to the victim's phone.
  4. The app is installed with no prompt on the device.
  5. Trigger the installed app, either by installing a second app or by pointing a hidden frame at a custom URI scheme the app handles.

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.

A web page that shows text typed by one user to other users must clean that text first. Here the app description was shown as-is, so a script hidden in it ran in the browser of everyone who looked at the page. The market could also send app installs to a phone signed in to the same account, with no prompt on the phone, so the script could quietly install and start an app.

What is XSS?

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

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.