Star

Deep link

Introduction

Why might that be a problem?

Because of Link Hijacking. This happen when a malicious app registers an URI that belongs to the victim app. If mobile OS redirects the user to the malicious app, it can lead to phishing (e.g., the malicious app displays forged UI to lure user passwords) or data leakage (e.g., the deep link may carry sensitive data in the URL parameters such as session IDs).

Suppose that:

  • The victim user have malicious app installed
  • Both apps (victim and malicious) manage geo://, https://google.com
Android Victim App installed Link supported URI Behavior
- N Scheme URL geo:// Open in malicious
- Y Scheme URL geo:// Dialog appear (malicious app, victim app)
< 12 N Web Links https://google.com Dialog appear (browser, malicious app)
< 12 Y Web Links https://google.com Dialog appear (browser, malicious app, victim app)
> 12 N / Y Web Links https://google.com Open in default browser
> 6 Y App Links https://google.com Open Victim App

Start an intent

adb shell am start -W -a android.intent.action.VIEW -d "geo://"

Testing

  • Testing (custom) Scheme URI: Check if there are any scheme URL. These types of deep links are not secure.
  • Testing Web Links: Check if there are any Web Links. If the app can be installed on Android < 12 they are not secure.
  • Testing App Links: Check if there are any App Links. If the app can be installed on Android < 12 proceed with testing.
    • Check for missing
      • Digital Asset Links file: https://myownpersonaldomain.com/.well-known/assetlinks.json , https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=myownpersonaldomain.com
    • Misconfigured
      • If the OS prompts you to choose between Browser and one or more apps, then the app link Verification process is not correctly implemented.