StrandHogg 攻擊/任務相依性安全漏洞
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
OWASP 類別:MASVS-PLATFORM:平台互動
總覽
StrandHogg 攻擊/任務相依性安全漏洞是由 Android 處理多項任務的方式設計錯誤所產生,特別是名為「重設任務父項」的功能。應用程式重設任務父項功能,可讓應用程式將活動從一項任務移到另一項任務。
如果沒有針對傳入的應用程式任務堆疊活動採取明確的檢驗方式,StrandHogg 攻擊就會運用這個漏洞,讓惡意應用程式執行以下動作:
- 將惡意活動移入或移出受害者的堆疊。
- 受害者的活動完成後,將惡意活動設為返回堆疊。
攻擊者會操控 allowTaskReparenting
和 taskAffinity
設定,惡意運用這個安全漏洞。
影響
惡意應用程式會根據目標應用程式的 packageName,設定其中一個活動的 taskAffinity。接著再結合意圖盜用攻擊,這樣一來,使用者下次啟動目標應用程式時,惡意應用程式也會同時啟動,並顯示在目標應用程式上方。
這個任務相依性漏洞就能用於盜用合法的使用者動作。
使用者可能會遭到誘騙,提供憑證給惡意應用程式。根據預設,一旦活動啟動並與任務建立關聯,該關聯會在活動的完整生命週期間持續有效。但是,如果將 allowTaskReparenting 設為 true,就會打破這個限制,允許將現有活動的父項重設為新建的「原生」任務。
舉例來說,應用程式 B 可以指定應用程式 A 為目標,在應用程式 A 完成活動的返回過程中,將應用程式 A 的活動重新導向至應用程式 B 的活動堆疊。使用者無法察覺這類應用程式之間的轉換,因而產生重大的網路詐騙威脅。
因應措施
更新為 android:targetSdkVersion=>28
。
StrandHogg 攻擊/任務相依性安全漏洞已在 2019 年 3 月修補完成,Android SDK 28 以上版本 (Android 9) 也提供適用的 OS 修補程式,避免出現這個安全漏洞。雖然您可以透過個別應用程式設定來緩解部分第 1 版的 StrandHogg 攻擊,但只有這個 SDK 版本修補程式能夠防範第 2 版的攻擊。
資源
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2024-01-05 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-01-05 (世界標準時間)。"],[],[],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)"]]