firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.24k stars 570 forks source link

Getting some security issues #6086

Closed devsideal closed 2 weeks ago

devsideal commented 3 weeks ago

This issue is referred from: https://github.com/firebase/flutterfire/issues/13053

Getting some security issues when scanning by appsweep with below packages:

cloud_firestore: ^5.0.1 showing Insecure hashing algorithm MD5 used with below findings: Screenshot from 2024-07-09 11-47-55

firebase_auth: ^5.1.0 showing Insecure hashing algorithm SHA1 used with below findings:

image image

firebase_messaging: ^15.0.1 showing Insecure hashing algorithm SHA-1 used with below findings: image

STR:

  1. Add all the given three packages and sync
  2. Build apk file
  3. Test the apk with any security testing tool like appsweep
  4. You will see that security issues.

Flutter version is: 3.22.2

google-oss-bot commented 3 weeks ago

I found a few problems with this issue:

dconeybe commented 3 weeks ago

Drive-by comment: Firestore does indeed use MD5, but not in a security context:

https://github.com/firebase/firebase-android-sdk/blob/ec68af618192de27d80a15e99fe9655d4629f2af/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/BloomFilter.java#L141

This code is part of the algorithm that keeps Firestore's local cache in sync with the server. This is not a security context. The warning about using an insecure hash algorithm can be safely ignored. We chose MD5 over a cryptographically-secure hashing algorithm because the performance of MD5 was measured to be significantly better and security was not needed for this particular hash.

devsideal commented 3 weeks ago

Thanks @dconeybe for the clarification, What's about the other issues?

dconeybe commented 3 weeks ago

I've added the "auth" tag so someone with auth expertise can comment.

gsakakihara commented 3 weeks ago

https://github.com/firebase/firebase-android-sdk/blob/f23f6f11610640d767dcda65702a21a7d61f5d27/firebase-messaging/src/main/java/com/google/firebase/messaging/GmsRpc.java#L247

firebase-messaging is using that value as an identifier for deduplication, not security, so there shouldn't be a security issue using SHA-1.