plaid / plaid-link-android

Plaid Link Android SDK
https://plaid.com/docs/link/android
MIT License
114 stars 48 forks source link

Security Issue: Protect App Screens from 3rd Party Apps #237

Open GangChenGoCode opened 1 year ago

GangChenGoCode commented 1 year ago

The problem

The App does not protect sensitive screens from being displayed in screencasts initiated by third-party Apps. Specifically, the following packages within the App contain vulnerable Activities:

Environment

Android OS Version above KitKat
Android Devices/Emulators all

Steps to Reproduce

Static Code Scanning

Expected Result

However, if the developers want to protect all the screens of their applications from third-party screen capturing and sharing, they need to use this flag in each of the Activities separately. There is no global mechanism to set this flag for all the screens at once. But, one can design their applications in such a way that the FLAG_SECURE needs to be used only once. Below is the code snippet:

/ Define a BaseActivity and set the FLAG_SECURE in that Activity : / public class BaseActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    /**
     * approach 1: create a base activity and set the FLAG_SECURE in it,
     * Extend all other activities, Fragments from this activity
     */
    getWindow().setFlags(LayoutParams.FLAG_SECURE,
            LayoutParams.FLAG_SECURE);
}

} Use this BaseActivity as the superclass for all the other Activities.

public class LoginActivity extends BaseActivity public class MainActivity extends BaseActivity

Screenshots

REGULATORY COMPLIANCE

This issue may be out of compliance with the following laws, policies, and standards:

OWASP Mobile Security OWASP Mobile Security Testing Guide No sensitive data, such as passwords or pins, is exposed through the user interface (MSTG-STORAGE-7) https://mobile-security.gitbook.io/masvs/security-requirements/0x07-v2-data_storage_and_privacy_requirements#security-verification-requirements