StrandHogg 攻击/任务相关性漏洞
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
OWASP 类别:MASVS-PLATFORM:平台互动
概览
StrandHogg 攻击/任务相关性漏洞是因 Android 处理多个任务的方式(尤其是称为“更改父级任务”的功能)存在设计上的 bug 而产生/引起的。应用更改父级任务是一项功能,可让应用将某个 activity 从一个任务移至另一个任务。
StrandHogg 攻击利用了传入应用任务堆栈 activity 审查方式不明确的缺陷,致使恶意应用可以执行以下任一操作:
- 将恶意 activity 移入或移出受害堆栈
- 受害 activity 运行完毕后,将恶意 activity 设置为返回堆栈。
攻击者通过操纵 allowTaskReparenting
和 taskAffinity
设置来利用此漏洞。
影响
恶意应用会根据目标应用的 packageName,相应地设置自己的某个 activity 的 taskAffinity。此手段随后与 intent 劫持相结合,会导致当用户下次启动目标应用时,恶意应用也同时启动并显示在目标应用之上。
然后,攻击者就可以利用此任务相关性漏洞劫持合法用户操作。
用户可能会被诱骗向恶意应用提供凭据。默认情况下,一旦 activity 启动并与任务关联,该关联就会在该 activity 的整个生命周期内持续有效。不过,将 allowTaskReparenting 设置为 true 会打破此限制,允许将某个现有 activity 的父级任务更改为新创建的“原生”任务。
例如,应用 A 可以通过应用 B 定位,在从应用 A 的已完成 activity 返回时,应用 A 的 activity 会被重定向到应用 B 的 activity 堆栈。从一个应用转换到另一个应用的过程不会向用户显示,这会产生严重的钓鱼式攻击威胁。
缓解措施
更新为 android:targetSdkVersion=>28
。
StrandHogg 攻击/任务相关性漏洞已于 2019 年 3 月进行修补,Android SDK 版本 28 及更高版本 (Android 9) 包含的相关操作系统补丁可避免此漏洞。虽然通过单独的应用配置可以缓解部分第 1 版 StrandHogg 攻击,但第 2 版攻击只能通过此 SDK 版本补丁来防范。
资源
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-13。
[null,null,["最后更新时间 (UTC):2023-12-13。"],[],[],null,["# StrandHogg Attack / Task Affinity Vulnerability\n\n\u003cbr /\u003e\n\n**OWASP category:** [MASVS-PLATFORM: Platform Interaction](https://mas.owasp.org/MASVS/09-MASVS-PLATFORM)\n\n\nOverview\n--------\n\nThe StrandHogg attack / Task Affinity vulnerability was enabled / caused by a\ndesign bug in the way Android handled multiple tasks, specifically the feature\ncalled task reparenting. Application task reparenting is a feature that allows\nan application to move an activity from one task to another.\n\nThe StrandHogg attack exploits a lack of clarity on how to vet incoming\napplication task stack activities and allows a malicious application to either:\n\n- move a malicious activity to or from a victim stack\n- set the malicious activity as the return stack upon completion of a victim activity\n\nThis vulnerability is exploited by manipulating the `allowTaskReparenting` and\n`taskAffinity` settings.\n\nImpact\n------\n\nA malicious application can set the taskAffinity of one of its activities to\nmatch the packageName of a target application. This can then be coupled with\nintent hijacking so that the next time the target application is launched by the\nuser, the malicious application is also launched and displayed on top of the\ntarget application.\n\nThe Task Affinity vulnerability can then be used to hijack legitimate user\nactions.\n\nThe user could be tricked into providing credentials to a malicious application.\nBy default, once an activity starts and is associated with a task, that\nassociation persists for the activity's entire lifecycle. However, setting\nallowTaskReparenting to true breaks this restriction, allowing an existing\nactivity to be re-parented to a newly created \"native\" task.\n\nFor example, App A can be targeted by App B, redirecting App A activities to an\nApp B activity stack upon return from App A's completed activity. This\ntransition from one app to another is hidden from the user and creates a\nsignificant phishing threat.\n\nMitigations\n-----------\n\nUpdate to `android:minSdkVersion=\"30\"`.\n\nThe StrandHogg attack / Task affinity vulnerability was originally patched in\nMarch 2019 with a newer and more comprehensive variant patched in September\n2020. Android SDK versions 30 and newer (Android 11) contain the appropriate OS\npatches to avoid this vulnerability. While it is possible to partially mitigate\nversion 1 of the StrandHogg attack through individual application configuration,\nversion 2 of the attack can only be prevented by this SDK version patch.\n\nResources\n---------\n\n- [Original academic paper describing the vulnerability at Usenix\n 15](https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-ren-chuangang.pdf){.external}\n- [Promon Security group's expansion of the original\n vulnerability](https://promon.co/security-news/the-strandhogg-vulnerability/){.external}\n- [Android developer documentation for android:allowTaskReparenting](/guide/topics/manifest/activity-element#reparent)\n- [Android developer documentation for android:taskAffinity](/guide/topics/manifest/activity-element#aff)\n- [Android developer documentation for the application element of android:allowTaskReparenting](/guide/topics/manifest/application-element#reparent)"]]