Skip to content

Commit f2ba4a5

Browse files
committed
Add description for insecure deep links (MASWE-0058)
1 parent 34b11d5 commit f2ba4a5

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

weaknesses/MASVS-PLATFORM/MASWE-0058.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,38 @@ mappings:
88
masvs-v1: [MSTG-PLATFORM-3]
99
masvs-v2: [MASVS-PLATFORM-1, MASVS-STORAGE-2, MASVS-CODE-4]
1010
cwe: [939, 917]
11-
12-
draft:
13-
description: e.g. use of URL Custom Schemes, unverified AppLinks/Universal Links,
14-
not validating URLs. Deep Link parameters offers a wide range of possibilities. A malformed URI or parameter value, if not sanitized, may trigger an injection in different points of the application. For example, CWE-939 prevents the exploit of the URI checking the source and CWE-917 prevents the exploit of the URI checking the content.
15-
topics:
16-
- URL Custom Schemes
17-
- AppLinks
18-
- Universal Links
19-
- URL validation
20-
- Check for OS version. e.g. deep link are more secure after Android XX
2111
refs:
2212
- https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links
23-
status: placeholder
24-
13+
- https://developer.android.com/training/app-links/verify-android-applinks
14+
status: new
2515
---
2616

17+
## Overview
18+
19+
Mobile apps often accept deep links to navigate to particular sections within the app or perform specific functionality. However, if not implemented securely, they can introduce vulnerabilities. Insecure deep links can lead to unauthorized access, data leakage, fault injection, command injection, phishing attempts or other security issues if they are not properly validated and sanitized.
20+
21+
## Impact
22+
23+
- **Unauthorized Access**: Attackers can exploit insecure deep links to access restricted areas of the app or perform actions without proper authentication or authorization.
24+
- **Phishing Attacks**: In combination with webviews, attackers can craft deep links that lead users to malicious (brand-alike) websites, potentially stealing sensitive information.
25+
- **Injection Attacks**: Malformed deep link parameters can be exploited to perform injection attacks such as command injection, or fault injection.
26+
- **Reputation Damage**: Exploitation of insecure deep links can lead to negative publicity and loss of user trust.
27+
- **App Crashes**: Improper handling of deep link parameters can lead to application crashes or unexpected behavior, affecting the user experience.
28+
29+
## Mode of Introduction
30+
31+
- **Too Wide URL parameter Acceptance**: Accepting deep links from untrusted domains or allowing overly broad URL patterns such as wildcard schemes.
32+
- **Improper Configuration**: Misconfiguring deep link handling, such as not restricting which domains can open the app, can lead to unauthorized access.
33+
- **Lack of Input Validation**: Failing to validate and sanitize deep link parameters can allow attackers to inject malicious input.
34+
- **Excessive Permissions**: Granting deep links access to sensitive app functionality or data without proper checks.
35+
- **Insecure WebView Integration**: If deep links open content in a WebView without proper security measures, it can lead to vulnerabilities like cross-site scripting.
36+
- **Inadequate Logging and Monitoring**: Failing to log deep link usage and monitor for suspicious activity can delay the detection of exploitation attempts.
37+
38+
## Mitigations
39+
40+
- Restrict Accepted Domains and parameters: Limit deep link handling to trusted domains and specific URL patterns. Avoid using wildcards in schemes or hostnames.
41+
- Validate and Sanitize Input: Always validate and sanitize deep link parameters to ensure they conform to expected formats and values.
42+
- Implement Proper Authorization Checks: Ensure that deep links do not bypass authentication or authorization mechanisms.
43+
- Secure WebView Usage: If using WebViews, ensure they are configured securely to prevent vulnerabilities like cross-site scripting, clickjacking or redirecting to malicious sites.
44+
- Fuzz Testing: Use fuzz testing to identify potential vulnerabilities in deep link handling.
45+
- Log and Monitor: Implement logging for deep link usage and monitor for unusual patterns that may indicate exploitation attempts.

0 commit comments

Comments
 (0)