CWE-925 广播接收机对意图的不当验证

admin 2021年12月4日16:23:08评论108 views字数 2069阅读6分53秒阅读模式

CWE-925 广播接收机对意图的不当验证

Improper Verification of Intent by Broadcast Receiver

结构: Simple

Abstraction: Variant

状态: Incomplete

被利用可能性: unkown

基本描述

The Android application uses a Broadcast Receiver that receives an Intent but does not properly verify that the Intent came from an authorized source.

扩展描述

Certain types of Intents, identified by action string, can only be broadcast by the operating system itself, not by third-party applications. However, when an application registers to receive these implicit system intents, it is also registered to receive any explicit intents. While a malicious application cannot send an implicit system intent, it can send an explicit intent to the target application, which may assume that any received intent is a valid implicit system intent and not an explicit intent from another application. This may lead to unintended behavior.

相关缺陷

  • 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'}

常见的影响

范围 影响 注释
Integrity Gain Privileges or Assume Identity Another application can impersonate the operating system and cause the software to perform an unintended action.

可能的缓解方案

Architecture and Design

策略:

Before acting on the Intent, check the Intent Action to make sure it matches the expected System action.

示例代码

The following example demonstrates the weakness.

bad XML


...

...

The ShutdownReceiver class will handle the intent:

bad Java


...

IntentFilter filter = new IntentFilter(Intent.ACTION_SHUTDOWN);
BroadcastReceiver sReceiver = new ShutDownReceiver();
registerReceiver(sReceiver, filter);
...

public class ShutdownReceiver extends BroadcastReceiver {

@Override
public void onReceive(final Context context, final Intent intent) {

mainActivity.saveLocalData();
mainActivity.stopActivity();

}

}

Because the method does not confirm that the intent action is the expected system intent, any received intent will trigger the shutdown procedure, as shown here:

attack Java

window.location = examplescheme://method?parameter=value

An attacker can use this behavior to cause a denial of service.

Notes

相关攻击模式

  • CAPEC-499

引用

文章来源于互联网:scap中文网

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年12月4日16:23:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-925 广播接收机对意图的不当验证http://cn-sec.com/archives/613372.html

发表评论

匿名网友 填写信息