【问题标题】:Intent Redirection Vulnerability Notification From Google Play来自 Google Play 的意图重定向漏洞通知
【发布时间】:2021-09-01 08:35:16
【问题描述】:

我为我的 android 应用程序构建了一个一键式同意 OTP 验证:https://developers.google.com/identity/sms-retriever/user-consent/request

我的代码唯一不同的是我改变了

override fun onCreate(savedInstanceState: Bundle?) {
    // ...

    val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
    registerReceiver(smsVerificationReceiver, SmsRetriever.SEND_PERMISSION, intentFilter)
}

在文章中,致:

  // ...
     val intenetFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
     registerReceiver(smsBroadcastReceiver, intenetFilter)

我删除了SmsRetriever.SEND_PERMISSION,因为我收到了如图所示的类型不匹配错误: 这可能是因为 Google 声明 here 表示 This permission setting is available in Google Play services version 19.8.31 or higher. 但是,我正在使用

implementation 'com.google.android.gms:play-services-auth:19.2.0'

implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.1'

在我的构建 gradle 中。我认为目前还没有 19.8.31 版本的 play-services-auth 可供下载。

然后我尝试了另一种方法,在我的 android 清单中为我的广播接收器添加了以下权限:

        <receiver
            android:name=".ui.otpVerification.SmsBroadcastReceiver"
            android:exported="true"
            android:permission="com.google.android.gms.auth.api.phone.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.gms.auth.api.phone.SMS_RETRIEVED" />
            </intent-filter>
        </receiver>

我认为这将解决意图漏洞问题,因为我正在为我的接收器设置 SEND_PERMISSIONpermission,如https://support.google.com/faqs/answer/9267555中所述

但是,当我创建新版本并将其提交以供审核时,我仍然收到返回 Intent 重定向漏洞的相同通知。有什么我做错了吗?还有什么需要考虑的吗?

【问题讨论】:

    标签: android broadcastreceiver google-play-services android-security sms-retriever-api


    【解决方案1】:

    我添加了以下内容,它起作用了。

      // ...
         val intenetFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
          registerReceiver(smsBroadcastReceiver, intenetFilter, SmsRetriever.SEND_PERMISSION, null)
    

    无需对 Android Manifest 执行任何操作。只改了上面那行。

    【讨论】:

      猜你喜欢
      • 2021-07-20
      • 1970-01-01
      • 2021-05-02
      • 1970-01-01
      • 1970-01-01
      • 2022-11-17
      • 2020-08-09
      • 2022-01-21
      相关资源
      最近更新 更多