How to prevent a hacker from reading/writing on firebase database

前端 未结 1 421
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 16:32

I have some questions about securing firebase database for mobile applications.

For example, after decompiling Android application a hacker can get firebase api key

1条回答
  •  天涯浪人
    2021-01-13 16:43

    after decompiling Android application a hacker can get firebase api key and then get access to firebase database, is this correct?

    Only if your database does not use any security rules that limit access to only authenticated users.

    if I configure facebook/google/ or even firebase email authentication I'm gonna need some api keys for those providers in my application, If a hacker got access to those keys, will he be able to use my authentication in his own application and get access to my firebase data?

    No, it doesn't work that way.

    Each user authenticated with Firebase is issued a token that's used to identify the user when they access protected services, such as Realtime Database, Firestore, or Storage. This token is valid 1 hour and must be refreshed after that, which the SDK will do automatically.

    For a hacker to gain control of that user's data, they would have to obtain this token, and they would have no more than an hour to work with it. After that, they would have to obtain the next token obtained by the SDK. All this would have to happen on the user's device.

    0 讨论(0)
提交回复
热议问题