ivyv19 / GitHub-Test-repo

for testing purposes only
0 stars 0 forks source link

NowSecure static analysis: App Declares Unverified Deep Links #1104

Open ivyv19 opened 1 week ago

ivyv19 commented 1 week ago

Finding Description

The app was found to declare unverified deep links.

Deep links are URIs of any scheme that take users directly to specific content in an app. An app can set up deep links by adding intent filters on the Android Manifest and extracting data from incoming intents to navigate users to the correct activity.

Using unverified deep links can cause a significant issue- any other apps installed on a user's device can declare and try to handle the same intent, which is known as deep link collision. Any arbitrary application can declare control over the exact same deep link belonging to another application.

In recent versions of Android this results in a so-called disambiguation dialog shown to the user that asks them to select the application that should handle the deep link. The user could make the mistake of choosing a malicious application instead of the legitimate one.

Evaluation Criteria:

The evidence table contains the activities that are associated with unverified deep links. You should inspect all these activities and check if they handle sensitive information. If so, this should be considered a vulnerability.

Steps to Reproduce

This test looks for deep links declared in the Android Manifest that employ a URL custom scheme or use HTTP/HTTPS and doesn't explicitly set android:autoVerify="true".

Business Impact

This flaw can potentially lead to a number of different exploits:

Remediation Resources

In order to solve the deep link collision issue, Android 6.0 (API Level 23) introduced Android App Links, which are verified deep links based on a website URL explicitly registered by the developer. Clicking on an App Link will immediately open the app if it's installed.

In order for Android to handle your deep links as App Links, you have to:

For example, if you have the following intent filter:

<activity android:name="com.nowsecure.example" android:autoVerify="true">
<intent-filter>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data android:host="www.nowsecure.com" android:scheme="https"/>
</intent-filter>
</activity>

The assetlinks.json file must reside in https://www.nowsecure.com/.well-known/assetlinks.json and should look like this:

[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
  "namespace": "android_app",
  "package_name": "com.example.puppies.app",
  "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
}
}]

The value of "package_name" should match your app's package name, "com.example.puppies.app" in this example, and the sha256_cert_fingerprints should match the fingerprints of your app's signing certificate.

Risk and Regulatory Information

Severity: info

Policy Category: Review Required

Application

See more detail in the NowSecure Report

Evidence #### Unverified Deep Links | Activity | Scheme | Host | |---|---|---| | com.instagram.barcelona.settingsdeeplinkhandleractivity.SettingsDeeplinkHandlerActivity | barcelona | settings | | com.instagram.barcelona.mainactivity.BarcelonaActivity | barcelona | media | | com.instagram.barcelona.mainactivity.BarcelonaActivity | barcelona | user | ... and 2 more