Firebase Api Key can be used at another App (Decompiled APK)
up vote
0
down vote
favorite
We were planning to use Firebase Anonymous Authantication and Realtime Database for our Android app. Then we wanted to try if our Firebase Api Key can be used in another app to access our Database and we've crated a fake app with same package name, put our existing Firebase Api Key to it and then signed it with brand new Sign key. Once we run it, it was able to access our previous apps firebase backend.
(Since Firebase Api key can be extracted from apk easily, we wanted to simulate the same action)
Despite the most of the answers says that Firebase checks the signature of the App, we were able to access the database with completely different APK.
Do I missing anything on the Firebase configuration side ?
Edit :
What I Did Step By Step :
1) Created a new Android Project with same package name of existing one.
2) Put the google-services.json of existing project to new project
3) Wrote the following code to new project
final FirebaseAuth mAuth;
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
final String TAG = "AuthTest";
mAuth.signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInAnonymously:success");
FirebaseUser user = mAuth.getCurrentUser();
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInAnonymously:failure", task.getException());
}
}
});
4) Signed the APK with completely new Signing Key
5) Run the Application on the device.
Result : Anonymous user was created on our existing Firebase Project
android firebase firebase-realtime-database firebase-authentication decompiling
add a comment |
up vote
0
down vote
favorite
We were planning to use Firebase Anonymous Authantication and Realtime Database for our Android app. Then we wanted to try if our Firebase Api Key can be used in another app to access our Database and we've crated a fake app with same package name, put our existing Firebase Api Key to it and then signed it with brand new Sign key. Once we run it, it was able to access our previous apps firebase backend.
(Since Firebase Api key can be extracted from apk easily, we wanted to simulate the same action)
Despite the most of the answers says that Firebase checks the signature of the App, we were able to access the database with completely different APK.
Do I missing anything on the Firebase configuration side ?
Edit :
What I Did Step By Step :
1) Created a new Android Project with same package name of existing one.
2) Put the google-services.json of existing project to new project
3) Wrote the following code to new project
final FirebaseAuth mAuth;
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
final String TAG = "AuthTest";
mAuth.signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInAnonymously:success");
FirebaseUser user = mAuth.getCurrentUser();
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInAnonymously:failure", task.getException());
}
}
});
4) Signed the APK with completely new Signing Key
5) Run the Application on the device.
Result : Anonymous user was created on our existing Firebase Project
android firebase firebase-realtime-database firebase-authentication decompiling
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
We were planning to use Firebase Anonymous Authantication and Realtime Database for our Android app. Then we wanted to try if our Firebase Api Key can be used in another app to access our Database and we've crated a fake app with same package name, put our existing Firebase Api Key to it and then signed it with brand new Sign key. Once we run it, it was able to access our previous apps firebase backend.
(Since Firebase Api key can be extracted from apk easily, we wanted to simulate the same action)
Despite the most of the answers says that Firebase checks the signature of the App, we were able to access the database with completely different APK.
Do I missing anything on the Firebase configuration side ?
Edit :
What I Did Step By Step :
1) Created a new Android Project with same package name of existing one.
2) Put the google-services.json of existing project to new project
3) Wrote the following code to new project
final FirebaseAuth mAuth;
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
final String TAG = "AuthTest";
mAuth.signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInAnonymously:success");
FirebaseUser user = mAuth.getCurrentUser();
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInAnonymously:failure", task.getException());
}
}
});
4) Signed the APK with completely new Signing Key
5) Run the Application on the device.
Result : Anonymous user was created on our existing Firebase Project
android firebase firebase-realtime-database firebase-authentication decompiling
We were planning to use Firebase Anonymous Authantication and Realtime Database for our Android app. Then we wanted to try if our Firebase Api Key can be used in another app to access our Database and we've crated a fake app with same package name, put our existing Firebase Api Key to it and then signed it with brand new Sign key. Once we run it, it was able to access our previous apps firebase backend.
(Since Firebase Api key can be extracted from apk easily, we wanted to simulate the same action)
Despite the most of the answers says that Firebase checks the signature of the App, we were able to access the database with completely different APK.
Do I missing anything on the Firebase configuration side ?
Edit :
What I Did Step By Step :
1) Created a new Android Project with same package name of existing one.
2) Put the google-services.json of existing project to new project
3) Wrote the following code to new project
final FirebaseAuth mAuth;
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
final String TAG = "AuthTest";
mAuth.signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInAnonymously:success");
FirebaseUser user = mAuth.getCurrentUser();
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInAnonymously:failure", task.getException());
}
}
});
4) Signed the APK with completely new Signing Key
5) Run the Application on the device.
Result : Anonymous user was created on our existing Firebase Project
android firebase firebase-realtime-database firebase-authentication decompiling
android firebase firebase-realtime-database firebase-authentication decompiling
edited Nov 19 at 23:12
Doug Stevenson
66.5k87997
66.5k87997
asked Nov 19 at 22:18
Eren Demir
9112
9112
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12
add a comment |
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383463%2ffirebase-api-key-can-be-used-at-another-app-decompiled-apk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you suggesting that you were able to authenticate as a user in the project from an app that was signed with a SHA-1 hash that was not added to the project? Please edit the question with exactly the tests you performed that you think should not have worked.
– Doug Stevenson
Nov 19 at 22:32
@DougStevenson Thanks for the comment. It is not the same as you described. I add the details to question.
– Eren Demir
Nov 19 at 23:12