Skip to content

Attribute requestLegacyExternalStorage set

Attribute requestLegacyExternalStorage set

Description

The android:requestLegacyExternalStorage attribute grants access to directories and different types of media files stored in external storage.

This attribute works only for Android 10 (API level 29), on Android 11 and later, the system ignores the requestLegacyExternalStorage flag.

Recommendation

Avoid setting the attribute android:requestLegacyExternalStorage and use only scoped storage to guarantee a better protection to app and user data on external storage.

<application android:icon="@drawable/icon" android:requestLegacyExternalStorage="true">

Standards

  • OWASP_MASVS_L1:
    • MSTG_STORAGE_4
  • OWASP_MASVS_L2:
    • MSTG_STORAGE_4
  • PCI_STANDARDS:
    • REQ_3_5
    • REQ_6_2
  • GDPR:
    • ART_5
    • ART_25
    • ART_32
  • OWASP_MASVS_v2_1:
    • MASVS_STORAGE_1
    • MASVS_STORAGE_2
  • SOC2_CONTROLS:
    • CC_2_1
    • CC_4_1
    • CC_7_1
    • CC_7_2
    • CC_7_4
    • CC_7_5