Improper Verification of Source of a Communication Channel

Incomplete Base
Structure: Simple
Description

The product establishes a communication channel to handle an incoming request that has been initiated by an actor, but it does not properly verify that the request is coming from the expected origin.

Extended Description

When an attacker can successfully establish a communication channel from an untrusted origin, the attacker may be able to gain privileges and access unexpected functionality.

Common Consequences 1
Scope: Access ControlOther

Impact: Gain Privileges or Assume IdentityVaries by Context

An attacker can access any functionality that is inadvertently accessible to the source.

Potential Mitigations 1
Phase: Architecture and Design
Use a mechanism that can validate the identity of the source, such as a certificate, and validate the integrity of data to ensure that it cannot be modified in transit using an Adversary-in-the-Middle (AITM) attack. When designing functionality of actions in the URL scheme, consider whether the action should be accessible to all mobile applications, or if an allowlist of applications to interface with is appropriate.
Demonstrative Examples 2

ID : DX-112

This Android application will remove a user account when it receives an intent to do so:

Code Example:

Bad
Java
java
This application does not check the origin of the intent, thus allowing any malicious application to remove a user. Always check the origin of an intent, or create an allowlist of trusted applications using the manifest.xml file.

ID : DX-109

These Android and iOS applications intercept URL loading within a WebView and perform special actions if a particular URL scheme is used, thus allowing the Javascript within the WebView to communicate with the application:

Code Example:

Bad
Java

// Android* @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ ``` if (url.substring(0,14).equalsIgnoreCase("examplescheme:")){ if(url.substring(14,25).equalsIgnoreCase("getUserInfo")){ writeDataToView(view, UserData); return false; } else{ return true; } } }

Code Example:

Bad
Objective-C

// iOS* -(BOOL) webView:(UIWebView *)exWebView shouldStartLoadWithRequest:(NSURLRequest *)exRequest navigationType:(UIWebViewNavigationType)exNavigationType { ``` NSURL *URL = [exRequest URL]; if ([[URL scheme] isEqualToString:@"exampleScheme"]) { NSString *functionString = [URL resourceSpecifier]; if ([functionString hasPrefix:@"specialFunction"]) {

objective-c
A call into native code can then be initiated by passing parameters within the URL:

Code Example:

Attack
JavaScript
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.
Observed Examples 3
CVE-2000-1218DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning
CVE-2005-0877DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning
CVE-2001-1452DNS server caches glue records received from non-delegated name servers
References 1
A Taxonomy of Security Faults in the UNIX Operating System
Taimur Aslam
01-08-1995
ID: REF-324
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Technologies:
Mobile : Undetermined
Modes of Introduction
Architecture and Design
Implementation
Notes
RelationshipWhile many access control issues involve authenticating the user, this weakness is more about authenticating the actual source of the communication channel itself; there might not be any "user" in such cases.