CWE-940 通信信道源的不正确验证
Improper Verification of Source of a Communication Channel
结构: Simple
Abstraction: Base
状态: Incomplete
被利用可能性: unkown
基本描述
The software 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.
扩展描述
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.
相关缺陷
-
cwe_Nature: ChildOf cwe_CWE_ID: 923 cwe_View_ID: 1000 cwe_Ordinal: Primary
-
cwe_Nature: ChildOf cwe_CWE_ID: 923 cwe_View_ID: 699 cwe_Ordinal: Primary
适用平台
Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}
Paradigm: {'cwe_Name': 'Mobile', 'cwe_Prevalence': 'Undetermined'}
常见的影响
范围 | 影响 | 注释 |
---|---|---|
['Access Control', 'Other'] | ['Gain Privileges or Assume Identity', 'Varies by Context'] | An attacker can access any functionality that is inadvertently accessible to the source. |
可能的缓解方案
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 a man-in-the-middle attack.
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 Android application will remove a user account when it receives an intent to do so:
bad Java
MyReceiver receiver = new MyReceiver();
registerReceiver(receiver, filter);
public class DeleteReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
destroyUserData(userID);
}
}
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 a whitelist of trusted applications using the manifest.xml file.
例
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:
bad Java
// Android
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url){
return false;
}
else{
}
}
}
bad Objective-C
// iOS
-(BOOL) webView:(UIWebView )exWebView shouldStartLoadWithRequest:(NSURLRequest )exRequest navigationType:(UIWebViewNavigationType)exNavigationType
{
if ([[URL scheme] isEqualToString:@"exampleScheme"])
{
if ([functionString hasPrefix:@"specialFunction"])
{
// Make data available back in webview.
UIWebView *webView = [self writeDataToView:[URL query]];
}
return NO;
}
return YES;
}
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-2000-1218 | DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-1218 |
CVE-2005-0877 | DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0877 |
CVE-2001-1452 | DNS server caches glue records received from non-delegated name servers | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2001-1452 |
Notes
相关攻击模式
- CAPEC-594
- CAPEC-595
- CAPEC-596
引用
文章来源于互联网:scap中文网
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论