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
AndroidVictim App installedLink supportedURIBehavior
-NScheme URLgeo://Open in malicious
-YScheme URLgeo://Dialog appear (malicious app, victim app)
< 12NWeb Linkshttps://google.comDialog appear (browser, malicious app)
< 12YWeb Linkshttps://google.comDialog appear (browser, malicious app, victim app)
> 12N / YWeb Linkshttps://google.comOpen in default browser
> 6YApp Linkshttps://google.comOpen 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.