Android: Intent Redirection Vulnerability
Android の Intent を使ってアプリの (private なものを含む) 任意の app component (Activity, Service など) にアクセスできてしまう脆弱性
これを読んで: https://support.google.com/faqs/answer/9267555
対策
redirect する app component を private (android:exported="false") にする
redirect する app component の呼び出し元が信頼できるものかチェックする
Activity#getCallingActivity()
ただし startActivityForResult で呼ばれた場合でないと null になるので使い所が限られる
実行する intent を制限する
package name とか class name をチェックする
PendingIntent を使う -> Android: PendingIntent
https://medium.com/androiddevelopers/android-nesting-intents-e472fafc1933
外部から見える app component, 見えない app component
AndroidManifest で <activity> <receiver> などに android:exported="true" が設定されてたら外から見える、 false だったら見えない
<activity> の default value
<intent-filter> が指定されている: true
<intent-filter> が指定されていない: false
See: https://developer.android.com/guide/topics/manifest/activity-element
Android 12 から入るチェック機構
StrictMode ね
https://developer.android.com/about/versions/12/behavior-changes-12#unsafe-intent-launches