StrandHogg 攻撃 / タスク アフィニティの脆弱性
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
OWASP カテゴリ: MASVS-PLATFORM: プラットフォームの操作
概要
StrandHogg 攻撃 / タスク アフィニティの脆弱性は、Android での複数のタスクの処理における設計上のバグ(特に、タスクの親変更)により発生しました。アプリタスクの親変更とは、アプリがあるタスクから別のタスクにアクティビティを移動させる機能です。
StrandHogg 攻撃は、外部アプリタスクのスタック アクティビティの審査方法の不明確性を悪用し、悪意のあるアプリが次のいずれかを行うことを可能にします。
- 被害を受けるスタックとの間で悪意のあるアクティビティを移動します。
- 被害を受けるアクティビティが完了したときに、悪意のあるアクティビティをリターン スタックとして設定します。
この脆弱性は、allowTaskReparenting
設定と taskAffinity
設定を操作することで悪用されます。
影響
悪意のあるアプリは、そのアクティビティのいずれかの taskAffinity を、ターゲット アプリの packageName と一致するように設定できます。これをインテント ハイジャックと組み合わせることで、ユーザーが次にターゲット アプリを起動させると、悪意のあるアプリもターゲット アプリの上で起動および表示されます。
タスク アフィニティの脆弱性を利用して、正当なユーザー アクションをハイジャックできます。
ユーザーをだまして、悪意のあるアプリに認証情報を提供させる可能性があります。デフォルトでは、アクティビティが開始してタスクに関連付けられると、その関連付けがアクティビティのライフサイクルを通じて維持されます。しかし、allowTaskReparenting を true に設定すると、この制限が解除され、既存のアクティビティを新しく作成された「ネイティブ」タスクに親変更できます。
たとえば、アプリ B がアプリ A をターゲットとし、完了して戻ったアプリ A のアクティビティを、アプリ B のアクティビティ スタックにリダイレクトします。このように、アプリ間での移行はユーザーには見えず、フィッシングの大きな脅威となります。
リスクの軽減
次のように更新
android:targetSdkVersion=>28
StrandHogg 攻撃 / タスク アフィニティの脆弱性は 2019 年 3 月にパッチが適用されています。Android SDK バージョン 28 以降(Android 9)には、この脆弱性を回避する適切な OS パッチが含まれています。個々のアプリ構成で StrandHogg 攻撃のバージョン 1 を部分的に軽減することは可能ですが、攻撃のバージョン 2 を防ぐにはこの SDK バージョン パッチを使用する必要があります。
参考資料
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2024-02-23 UTC。
[[["わかりやすい","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-02-23 UTC。"],[],[],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)"]]