跳转至

Unused permissions (overprivileged)

未使用的权限(权限过高)

描述

应用程序请求了权限,但从未使用过授予的资源。

建议

从应用程序的清单(manifest)中删除声明但未使用的权限。

例如,如果应用程序声明了 ACCESS_FINE_LOCATION 权限但并未实际使用,您可以将其从应用程序清单中删除:

  • 修改前:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <!-- Other application components -->
    </application>

</manifest>
  • 修改后:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <!-- Other application components -->
    </application>

</manifest>

链接

标准

  • OWASP_MASVS_L1:
    • MSTG_PLATFORM_1
  • OWASP_MASVS_L2:
    • MSTG_PLATFORM_1
  • CWE_TOP_25:
    • CWE_276
  • PCI_STANDARDS:
    • REQ_6_2
    • REQ_7_3
  • OWASP_MASVS_v2_1:
    • MASVS_PRIVACY_1
  • CNIL_FOR_EDITORS:
    • EDITORS_5_1_1
  • HIPAA_CONTROLS:
    • SECURITY221
    • SECURITY212
    • SECURITY213