Skip to content
RCE Write-up Intermediate

RCE in duolingos tinycards app from android

The TinyCards Android app loaded its initial web content over HTTP, allowing a man-in-the-middle attacker to inject arbitrary JavaScript into the WebView. This could lead to code execution within the app.

Nightwatch Cybersecurity Follow

Published on wwws.nightwatchcybersecurity.com

The TinyCards Android application provided by DuoLingo can be injected with malicious content by an MITM attacker. Because this application is a web-app framed in an Android WebView, this can lead to JavaScript being executed within the app by running JavaScript [which Google calls remote code execution (RCE)].

Nightwatch Cybersecurity (@nightwatchcyber), on wwws.nightwatchcybersecurity.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

The app used an HTTP URL for its initial web content load, allowing interception and modification by a network attacker.

Impact

An attacker on the same network could inject and run arbitrary JavaScript within the app, potentially leading to code execution or UI manipulation.

What the attacker needed

Attacker on same network; victim uses the app

The fix

The vendor changed the initial URL to use SSL, fixing the issue in version 1.0 (version code 10).

How it was found

  1. Install the app on the Android device but do not start it.
  2. Install dnsmasq and NGINX on a Linux host.
  3. Modify /etc/hosts to map the domain to the Linux host.
  4. Configure dnsmasq to listen on the host IP and restart it.
  5. Place a malicious index.html file in the web server root.
  6. Set the Android device's DNS to the Linux host and open the app.

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.

When an app loads a website without encryption (HTTP instead of HTTPS), someone on the same network can intercept and change the content. In this case, the app displayed web pages inside a WebView, so the attacker could insert malicious JavaScript that ran inside the app. This is dangerous because the attacker could then control what the app shows or does.

What is RCE?

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

More by Nightwatch Cybersecurity

View all

4 more disclosed reports, best first.

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.