Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added discussion of intents and taint flow analysis

In Android apps, data can be communicated via intents, or data can be written to files, distributed using shared preferences, or stored in databases.  In all these casecases, if the data is sensitive, it is important to keep the data secure.  That is, it should not be possible for other apps (or, more strictly, apps with different userids) to be able to access this data, or for the data to be accessible to other programs or people, if the data . This can be ensured by owner does not intend that. 

Data security (for non-intent communication channels) can be supported by creating the file, shared preference or database with MODE_PRIVATE on internal storage or with MODE_PRIVATE and encrypted (using secure encryption techniques, and using an encryption key only secure parties/apps have) on external storageMODE_PRIVATE is a constant defined by the class android.content.Context. It may be used as the mode parameter in the methods openFileOutput(), getSharedPreferences(), and openOrCreateDatabase() (which are all also defined in the class android.content.Context).

Static taint flow analysis can be done for a set of apps, to trace data from each source (an input of data which cannot be fully predicted by static analysis, e.g., text input by a user) to reachable sinks (data output to a location that other applications or methods can access, e.g., sending the data over a bluetooth connection). Taint flow analysis helps users understand many possible source to sink flows, including flows that include intents and/or static fields.

Noncompliant Code Example

...

Automatic detection of the mode used when a file, shared preference, or database is created is straightforward. It is not feasible to automatically determine whether the data written to the fileto an intent, file, shared preference, or database is sensitive.

Automated static taint flow analysis can be done for a set of apps, to trace data from each source (an input of data which cannot be fully predicted by static analysis, e.g., text input by a user) to reachable sinks (data output to a location that other applications or methods can access, e.g., sending the data over a bluetooth connection). Taint flow analysis helps users understand many possible source to sink flows, including flows that include intents and/or static fields. However, we know of no combination of native code analysis (where the native code analysis is not only heuristic, but actually statically analyzes the native code) and reflection analysis with the kind of taint flow analysis which includes intents and static fields. Therefore, current taint flow analyses are not sound: some source-to-sink dataflows can be missed.

Bibliography