结构: Simple
Abstraction: Base
状态: Incomplete
被利用可能性: unkown
The software uses a handler for a custom URL scheme, but it does not properly restrict which actors can invoke the handler using the scheme.
Mobile platforms and other architectures allow the use of custom URL schemes to facilitate communication between applications. In the case of iOS, this is the only method to do inter-application communication. The implementation is at the developer's discretion which may open security flaws in the application. An example could be potentially dangerous functionality such as modifying files through a custom URL scheme.
cwe_Nature: ChildOf cwe_CWE_ID: 862 cwe_View_ID: 699 cwe_Ordinal: Primary
cwe_Nature: ChildOf cwe_CWE_ID: 862 cwe_View_ID: 1000 cwe_Ordinal: Primary
Paradigm: {'cwe_Name': 'Mobile', 'cwe_Prevalence': 'Undetermined'}
策略:
Utilize a user prompt pop-up to authorize potentially harmful actions such as those modifying data or dealing with sensitive information. When designing functionality of actions in the URL scheme, consider whether the action should be accessible to all mobile applications, or if a whitelist of applications to interface with is appropriate.
This iOS application uses a custom URL scheme. The replaceFileText action in the URL scheme allows an external application to interface with the file incomingMessage.txt and replace the contents with the text field of the query string.
External Application
good Objective-C
Application URL Handler
bad
The handler has no restriction on who can use its functionality. The handler can be invoked using any method that invokes the URL handler such as the following malicious iframe embedded on a web page opened by Safari.
attack HTML
The attacker can host a malicious website containing the iframe and trick users into going to the site via a crafted phishing email. Since Safari automatically executes iframes, the user is not prompted when the handler executes the iframe code which automatically invokes the URL handler replacing the bookmarks file with a list of malicious websites. Since replaceFileText is a potentially dangerous action, an action that modifies data, there should be a sanity check before the writeToFile:withText: function.
These Android and iOS applications intercept URL loading and perform special actions if a particular URL scheme is used, thus allowing the Javascript within the WebView to communicate with the application:
bad Java
bad Objective-C
A call into native code can then be initiated by passing parameters within the URL:
attack JavaScript
Because the application does not check the source, a malicious website loaded within this WebView has the same access to the API as a trusted site.
标识 | 说明 | 链接 |
---|---|---|
CVE-2013-5725 | URL scheme has action replace which requires no user prompt and allows remote attackers to perform undesired actions. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5725 |
CVE-2013-5726 | URL scheme has action follow and favorite which allows remote attackers to force user to perform undesired actions. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5726 |