Replies: 1 comment
-
Hey @azabost, first of all, thank you very much for taking the time to send us this very detailed analysis and apologies for the delay in responding. Please note that these chapters are not necessarily meant to be recommendations (that's the work of the vulnerability and mitigation teams). They describe how things work on the platform. However, you are right about the inconsistencies, so thank you! I think these nuances are worth noting, even in the theory chapters. Storing unencrypted sensitive data on internal storage may or may not be a problem, depending on the threat model of the target application. As the paragraph you copied states:
This is done according to the profiles we have defined: Introducing MAS Testing Profiles: A Comprehensive Approach to Mobile App Security Verification MAS-L1 assumes that:
Root detection is therefore “out of scope” here, it’s a hardening measure that can be applied as an additional protection but knowing that it can be bypassed. If the goal is to retrieve files stored in the internal storage, e.g. a DB containing data that’s proprietary to the developers. An attacker with root access will be able to obtain that data, even if it’s encrypted. So the encryption is really protecting from trivial retrieval and from the case where the data may be unintentionally exposed to other apps. So this is the plan:
|
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I've come across what seems to be an inconsistency in the recommendations regarding internal storage encryption for Android. I'd like to get some clarification and share thoughts on this.
These recommendations state that sensitive data should not be stored unencrypted in SharedPreferences or a database:
However, another paragraph about plain files in internal storage does not mention the need for encryption.
This strikes me as inconsistent because both SharedPreferences and databases are also stored in internal storage.
From my understanding, data stored in internal storage—be it a plain file, SharedPreferences, or a database—is only accessible to the owning app itself as long as the device is not rooted. Given this, I'm questioning whether storing unencrypted sensitive data in internal storage truly poses a security risk under normal conditions. Does the omission of encryption requirements for plain files in internal storage imply that encryption isn't strictly necessary in such cases? Or is this an oversight that should be addressed for consistency in the guidelines?
MASTG-TEST-0001 makes the following distinction:
which seems reasonable to me.
MASWE-0006 mentions a few circumstances when storing unencrypted data on the internal storage could pose a risk:
While a device vulnerability can't be foreseen by the application author, all the other cases seem to be preventable or debatable:
Context.MODE_PRIVATE
is obligatory since API 17 (according to this)That being said, I'm unsure if storing unencrypted sensitive data on internal storage is actually a big problem or not. Or how big of a problem it is.
Since I'm not too experienced with rooting, I'm also unsure if the root detection mechanisms are reliable enough to assume that their presence can justify storing unencrypted data on internal storage.
Looking forward to hearing others' perspectives on this.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions