-
Notifications
You must be signed in to change notification settings - Fork 43
Description
We persist secrets (e.g. ABLY_DEVICE_SECRET) and tokens (e.g. ABLY_DEVICE_IDENTITY_TOKEN) to SharedPreferences without encryption or any other form of obfuscation, in terms of both values and the keys they are stored under.
This has been raised by a customer who discovered this when doing a security test after they "rooted" their app.
When Ably first implemented LocalDevice storage, there wasn't anything we deemed suitable that would give any material increase in security, hence the implementation was kept simple.
Perhaps the best solution going forward would be to allow app developers to override the storage I/O in order to provide their own encryption and/or platform service designed for secrets. Such a provider might be as simple as:
interface Storage {
void write(String key, String value);
String read(String key, String defaultValue);
}We would provide a default implementation using shared preferences, as we do currently.
I would also suggest we look at fixing #562 when we work on this as it's in the same area of the codebase.