Starting with Android 13, the system will display any text that is copied in a popover UI on the user's screen. If the user has copied sensitive content (such as a password), this can lead to sensitive data exposure.
To mitigate this risk factor, Android 13 introduces a new flag, EXTRA_IS_SENSITIVE, that can be applied to data copied to the clipboard. If this flag is applied, the system will treat the data copied to the clipboard as sensitive and will refrain from displaying it on the user's screen.
Possible Implementations
ClipboardModule.java needs the following added before setPrimaryClip in setString. This could be an optional flag passed to setString
public void setString(String text, Boolean isSensitive) {
try {
ClipData clipdata = ClipData.newPlainText(null, text);
if (isSensitive) {
PersistableBundle extras = new PersistableBundle();
extras.putBoolean("android.content.extra.IS_SENSITIVE", true);
clipdata.getDescription().setExtras(extras);
}
...
Describe the Feature
Starting with Android 13, the system will display any text that is copied in a popover UI on the user's screen. If the user has copied sensitive content (such as a password), this can lead to sensitive data exposure. To mitigate this risk factor, Android 13 introduces a new flag,
EXTRA_IS_SENSITIVE
, that can be applied to data copied to the clipboard. If this flag is applied, the system will treat the data copied to the clipboard as sensitive and will refrain from displaying it on the user's screen.Possible Implementations
ClipboardModule.java
needs the following added beforesetPrimaryClip
insetString
. This could be an optional flag passed tosetString
Related Issues