Data leak possible due to public function [Bug]
Reproduction Steps
These steps are for android (java) 1.open the cradle file 2. follow the path src/main/java/com/ichi2/anki/MyAccount.java
Expected Result
Data leak when attempt login() called ,as the function is public
Actual Result
The function must be made private, to ensure data leak is prohibited
Debug info
AnkiDroid Version- latest version (from the master branch)
Android version-10
Refer to the support page if you are unsure where to get the "debug info".
Research
Enter an [x] character to confirm the points below:
- [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
- [x] I have checked the manual and the FAQ and could not find a solution to my issue
- [x] I have searched for similar existing issues here and on the user forum
- [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Can I work on this issue ?
I agree it's uselessly public and would accept a change making functions private, it do not seems it can hurt. But I'd like to ask whether you see any way it could leak value currently? Even if someone could force attemptLogin to be called from another class, I can't see how this particularly can leak value.
On such a small issue, changing public to private, where the change is no longer/more complex than the code, I'd be find having a PR directly. I don't expect the bug report help a lot. This is limited to really small code change like this one, or like a typo, or adding comments to code.
If @imaryandokania found the issue, I guess @imaryandokania should also have priority if you want to work on it. Otherwise, fine @Akshay0701. Plesae let us know @imaryandokania
Yes i agree this is a minor issue, but what if i create a custom patch using lucky patcher or other apps, and allowing to target a particular attemptlogin function , and causing it to invoke a new database connectivity by adding a simple(json) file and pushing data after every attempt login function is called. More over, for this issue I would like to work,i see some more security issues like even MetaDB.java has public functions . I would like to work on improving security in this app. I will create pr for this issue as well as other security threat function, if you want!
I'm going to put myself out here. I don't understand how this could cause a data leak.
Could you explain this to me like I'm a (competent) beginner
My thoughts:
If you can rewrite the code of the application (lucky patcher), and pass signing verification then by definition you can control the data that the app. If you can rewrite the code, then you can easily change a few bytes to make a method public, so I don't see what making the function private would do.
If an OS exploit allows rewriting and running the app, then there's very little that we can do to protect against this, and it's outside our control.
Again, if you can call an arbitrary public function from outside the app, then that's an issue. But I don't see evidence of this.
I do not know lucky patcher. A quick search seems to indicate a user has to install it by themselves. If someone has enough control over the phone to get this app installed, then I don't believe that we can make anything to keep this app secure in any way. Clearly, securing an attack against the app by someone having control over the phone is NOT a priority, and I clearly won't spend time trying to understand such PR if it has any complexity. We don't manipulate any money, not even in form of advertisement, at most we ask for donation during updates and that's it. We don't have any secure data, all datas are available on the sd card uncrypted, and we never suggested data are more private than any random image saved on your phone. So we are not protecting data. Worst, we don't save the password, but we save a key which allow to authenticate the app, so if someone has control over the phone, they can change any data and sync already.
At best this would protect the password. and normally the password have little importance. If the user use the same password on multiple website, it may be a problem, but I don't consider ankidroid to be a cause of the problem here, and that's probably a very inefficient way to attack anyway.
The only trouble I could think of if the password is unique is that it would allow to modify shared deck and add-on on ankiweb. It's clear that the way add-on are dealt with is not ideal right now, but I don't think this is any practical way to diminish the risk
Yes , I agree with you since the app is not oriented towards any sensitive credentials , so this issue is not appropriate.