OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

Security alert from Google Play

Open congdanh1608 opened this issue 6 years ago • 28 comments

Description: I received an security alert notification from Google Play: `Security alert

Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Centre article for details.

Vulnerable locations:

com.onesignal.PushRegistratorFCM->getApiKey`

Environment

  1. Android SDK 28
  2. OneSignal 3.12.4

How I can fix this issue? Thanks,

congdanh1608 avatar Mar 03 '20 05:03 congdanh1608

Add restrictions to your API key so that only your apps are allowed to use the API key. More details on adding restrictions to API keys can be found here.

rgomezp avatar Mar 03 '20 22:03 rgomezp

Add restrictions to your API key so that only your apps are allowed to use the API key. More details on adding restrictions to API keys can be found here.

Thanks We already did the restriction on API keys, but the Security alert still on Google Play console. Does it effect to our app?

congdanh1608 avatar Mar 04 '20 00:03 congdanh1608

Hello everyone. We have the same Security alert after update to the OneSignal 3.12.7.

vzlomvl avatar Mar 04 '20 09:03 vzlomvl

Same issue here.

I believe the actual issue here is with the FCM_DEFAULT_API_KEY.

noahcooper avatar Mar 04 '20 10:03 noahcooper

I think that too: https://github.com/OneSignal/OneSignal-Android-SDK/blob/a3b21d30afe05bb7b14ca35234a6870eaf8205df/OneSignalSDK/onesignal/src/main/java/com/onesignal/PushRegistratorFCM.java#L47-L49

@rgomezp

rborn avatar Mar 04 '20 11:03 rborn

I think this key should not be public. https://github.com/OneSignal/OneSignal-Android-SDK/blob/a3b21d30afe05bb7b14ca35234a6870eaf8205df/OneSignalSDK/onesignal/src/main/java/com/onesignal/PushRegistratorFCM.java#L49

Solution could be one of below:

  1. use GCP service accounts (full details)
  2. Add restrictions to your API key (full details)

Expected that OneSignal team will work on this issue asap. below is exact screenshot that I received from my play consol account. apk_issue_one_signal

Above screenshot redirects me to this link and same solution links I have mentioned above.

here is my build.gradle configuration for your respective troubleshooting.

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/'}
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.6'
    }
}

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 2
        versionName "1.0.1" 
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {
        manifestPlaceholders = [
                onesignal_app_id: 'I_CAN_NOT_SHOW_THIS_HERE',
                onesignal_google_project_number: 'REMOTE'
        ]
    }
}

dependencies {
implementation 'com.onesignal:OneSignal:3.12.7'
}

If needed any more information, please let us know. we can provide it straight away. Also, its humble request to other developers to share the best solution, just in case if there is any (before onesignal team makes any changes into it).

Thanks in advance :)

AnkurJagani avatar Mar 05 '20 07:03 AnkurJagani

@rgomezp Are you reviewing on this issue? As you can check in my shared screenshot that Google Play Consol team clearly mentioning that issue is here.

Please help us at earliest before playstore takes any strict action on our app(s).

AnkurJagani avatar Mar 06 '20 11:03 AnkurJagani

Thanks for reporting. This is a false positive so you can safely ignore. We are looking into making a change to prevent Google from throwing this as a warning.

jkasten2 avatar Mar 06 '20 19:03 jkasten2

Okay, please let us know when this change will be made available, and steps to take to remove the warning from Google. @jkasten2

upenr avatar Mar 10 '20 16:03 upenr

Same error here (https://support.google.com/faqs/answer/9287711):

image

viniciusalvesmello avatar Mar 12 '20 11:03 viniciusalvesmello

We also got the same warning

Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details.

Vulnerable locations:

com.onesignal.PushRegistratorFCM->getApiKey Affects APK version 17.

jackatpw avatar Mar 12 '20 12:03 jackatpw

Security alert

Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details.

Vulnerable locations:

com.onesignal.PushRegistratorFCM->getApiKey Affects APK version 1.

DaxeshV avatar Mar 13 '20 09:03 DaxeshV

Thanks for reporting. This is a false positive so you can safely ignore. We are looking into making a change to prevent Google from throwing this as a warning.

I know its warning. but I have used one signal on my many client applications. but last few days many clients prompt me for a solution. now things go worst. we are waiting for a better solution but now time to move with firebase notification. so in future, we never face again this kind of security issue.

DaxeshV avatar Mar 13 '20 09:03 DaxeshV

Will downgrading to a lower version work? Having this issue after I upgraded to 3.12.7

heykooldude avatar Mar 15 '20 02:03 heykooldude

We are shooting for an SDK update later this week with a fix for this false positive security warning as well as a few other SDK improvements.

@DaxeshV To work around the issue for today if you need to remove this warning for your clients I recommend using using OneSignal 3.12.6 for the time being. OneSignal 3.12.7 is only required if you use com.google.firebase:firebase-messaging:20.1.0 or newer. By default OneSignal depends on com.google.firebase:firebase-messaging:[10.2.1, 17.3.99] so in most cases this should be fine.

jkasten2 avatar Mar 16 '20 18:03 jkasten2

Well. I have same with this issues.

luutruong avatar Mar 17 '20 08:03 luutruong

We the same issue. Patiently waiting for a fix 🙏

yaronlevi avatar Mar 17 '20 14:03 yaronlevi

Security alert

Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Centre article for details.

Vulnerable locations:

com.onesignal.PushRegistratorFCM->getApiKey i have same also !!?

hamza-ahmed avatar Mar 18 '20 11:03 hamza-ahmed

Do you have an ETA for the update?

emmanuel-marty avatar Mar 21 '20 08:03 emmanuel-marty

Any update on this? We the same issue. Some security check apps, such as Galaxy's Device Care app, say our app is 'MALWARE' because of this and not a few of our users have uninstalled the app, writing bad reviews on the Google play store. More and more newbies sees those reviews, the rating of the app has fallen and the number of new users has decreasing. It's CRITICAL.

s-ovation avatar Mar 24 '20 07:03 s-ovation