Skip to content
RCE Write-up Intermediate

From Deep Link to Shell: Easy $3000 Android Crits.

The GuessMe Android app exposed a JavaScript interface method that executed its argument as a shell command, and its deep link validation could be bypassed to load attacker-controlled HTML in a WebView. An attacker could therefore run arbitrary commands on the device.

medium.com

Published on medium.com

🔗READ FOR FREE

tinopreter, on medium.com

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 exposed a JavaScript bridge method that passed its argument directly to a shell command, and its deep link validation only checked that the URL ended with a trusted domain, which could be bypassed with a query or fragment suffix.

Impact

An attacker could execute arbitrary shell commands on the victim's device, leading to remote code execution.

What the attacker needed

Victim installs and opens a malicious app; or attacker uses ADB access

How it was found

  1. Host a malicious HTML page that calls the exposed getTime method with a command.
  2. Craft a deep link with a valid scheme and host, and a url parameter pointing to the malicious page with a suffix to pass the ends-with check.
  3. Build an exploit app that sends an intent to the exported WebViewActivity with that deep link.
  4. Run the exploit app and click the button to launch the GuessMe app.
  5. Observe the command output displayed in the WebView.

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 deep link is a special web address that opens a specific screen inside an app. This app had a hidden bridge that let a web page ask the phone to run a system command, and the app's checks on which web pages it would load could be tricked. So a malicious page could make the phone run commands chosen by the attacker.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.