Insecure Deep Link Handling
The app acts on deep links without validating their source or parameters, so a crafted link can open sensitive screens, trigger actions or load attacker content.
| Severity | Medium |
| CVSS 3.1 | 5.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N Open in the calculator |
| CVSS 4.0 | 5.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-939: Improper Authorization in Handler for Custom URL Scheme |
| Category | Input Validation |
Description
Deep links let other apps, web pages and messages open specific screens of an app through custom URL schemes, Android App Links or iOS Universal Links. Any app or web page can send a link to a custom scheme, and custom schemes are not owned by any app, so another app can register the same scheme and receive links intended for the real one: a malicious app on the device can capture OAuth authorisation codes or tokens that links carry through a custom scheme. App Links and Universal Links avoid this only when the association with the organisation's domain is verified.
The weakness arises when the app trusts the link: it performs actions, such as changing settings, making payments or linking accounts, without confirmation; opens screens that should require authentication; loads a URL from a parameter into a WebView, sometimes with the user's session; or passes parameters into file paths, queries or internal intents without validation. An attacker who persuades a user to open a crafted link, for example in a message or on a web page, can then make the app perform actions on the user's behalf, bypass screens that should require authentication, display phishing content inside the trusted app, or, through a WebView, steal session tokens. The attack requires user interaction, which limits but does not prevent it.
Testing lists the link handlers from the Android manifest's intent filters and from the iOS Info.plist and associated domains, then opens crafted links, for example with adb shell am start -d or from a web page, and observes the app's behaviour.
Remediation
- Treat all deep link data as untrusted input: validate the host, path and every parameter against what the target screen expects, and reject anything else.
- Require the user to be authenticated, and to confirm, before performing any state-changing or sensitive action that a link initiates.
- Do not load URLs from link parameters into WebViews unless they match an allowlist of the organisation's own hosts, and never attach session tokens to them.
- Prefer verified Android App Links (
android:autoVerify="true"with a Digital Asset Links file) and iOS Universal Links (with anapple-app-site-associationfile) over custom schemes, especially for links that carry codes or tokens, and use PKCE in OAuth flows.
Confirm the fix by repeating the crafted links and checking that each one is rejected or requires authentication and confirmation.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.