본문으로 건너뛰기
Skillpedia
보안10k · #11933

android-permissions-security

하는 일

이 스킬은 Android 권한과 다른 앱이 접근할 수 있는 구성 요소의 보안을 점검합니다. 런타임 권한 요청도 다룹니다. 최소 권한 원칙을 적용하려는 Android 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓AndroidManifest의 권한을 검토하고 앱에 필요 없는 권한을 제거하고 싶을 때.
  • ✓앱의 외부 노출 구성 요소를 보호하기 위해 커스텀 권한을 정의하고 싶을 때.
  • ✓서비스나 프로바이더에서 호출하는 앱의 신원을 확인해야 할 때.

스킬 링크

https://github.com/android/skills/blob/main/security/android-permissions-security/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/android/skills/blob/main/security/android-permissions-security/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 AndroidManifest의 권한을 검토하고, 다른 앱이 호출할 수 있는 서비스와 리시버를 보호해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 매니페스트에서 위험한 권한 설정과 외부 노출 구성 요소를 확인합니다. 그다음 커스텀 권한, 호출 앱의 서명 확인, 올바른 런타임 권한 흐름 같은 수정안을 권합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Guidelines for auditing permission vulnerabilities, enforcing least privilege, securing IPC boundaries, and handling runtime permissions across the Android ecosystem.

Glossary

  • Runtime Permission: Dangerous permission (e.g., Camera, Location) that must be granted by the user at runtime on Android 6.0+ (API 23+).
  • Custom Permission: A permission defined by an app (<permission>) to restrict access to its exported components.
  • Protection Level: Attribute defining how the OS grants the permission (normal, dangerous, signature, knownSigner).
  • knownSigner: Protection flag (API 31+) granting signature-level access to partner apps matching trusted certificate digests.
  • SigningInfo: Object (API 28+) providing signing history and multiple signer certificates for an application.
  • Binder Calling Identity: Reliable UID representing the calling process obtained using Binder.getCallingUid().
  • URI Permission: Temporary, granular access granted to a content URI using grantUriPermissions and intent flags.

Prerequisites

  • Add androidx.core:core-ktx and androidx.activity:activity-ktx (or androidx.fragment:fragment-ktx) dependencies to the app-level build.gradle file for ContextCompat and ActivityResultContracts.
  • For knownSigner partner permissions (android:knownCerts), ensure the project compileSdk and targetSdk are at least 31 (Android 12).
  • For broadcast identity sharing (BroadcastOptions.setShareIdentityEnabled), ensure compileSdk and targetSdk are at least 34 (Android 14).

1. Security audit and permission gap detection playbook

When auditing an Android project for permission and IPC security vulnerabilities, systematically inspect each area:

Vulnerability Area Search In / Pattern Risk Remediation Action
Weak Custom Permission Protection AndroidManifest.xml with android:protectionLevel="normal", "dangerous", or "signatureOrSystem" Unauthorized apps request or claim permission without restriction Upgrade to signature or signature with knownSigner and android:knownCerts.
Overly Broad URI Permission Grants <grant-uri-permission android:pathPrefix="/" /> or pathPrefix="" in <provider> Leaks all provider data to third parties Replace with explicit scoped subpath (e.g. android:pathPrefix="/shared/"). Retain android:grantUriPermissions="true". Remove any wildcard pathPrefix="/".
Missing ContentProvider Split Permissions <provider> with only generic android:permission or missing android:readPermission and android:writePermission Read-only callers execute write operations or write-only callers access read operations Configure granular android:readPermission="...READ_DATA" and android:writePermission="...WRITE_DATA", AND declare the custom <permission> tags with android:protectionLevel="signature" (or signature with knownSigner) at the <manifest> root.
Spoofable Caller Identity Checks intent.getStringExtra("calling_package"), intent.getStringExtra("sender"), callingPackage == "..." in Services Malicious callers forge intent extras or strings Remove string checks; authenticate caller UID cryptographically using Binder.getCallingUid() and pm.hasSigningCertificate().
Bound Service Permission Bypass checkCallingOrSelfPermission() or enforceCallingOrSelfPermission() in Binder AIDL stubs Falls back to host app UID outside IPC or when identity is cleared, causing Confused Deputy bypass Replace with enforceCallingPermission("...WRITE_DATA", ...) or checkCallingPermission("...WRITE_DATA").
Missing Method-Level Checks in Bound Services Bound Service AIDL methods mutating state without enforcing write permissions Callers with read-only binding access invoke mutating write operations Add enforceCallingPermission("...WRITE_DATA", "Caller lacks WRITE_DATA permission") inside mutating AIDL methods.
Flawed Runtime Permission Flow Missing shouldShowRequestPermissionRationale(), missing permanent denial handling, or re-requesting in loops Poor user experience, infinite loops, or inability to recover permissions Implement 3-state flow: check grant -> check rationale dialog -> launch contract. On permanent denial, redirect to Settings.ACTION_APPLICATION_DETAILS_SETTINGS.
Simultaneous Location Requests `arrayOf(ACCESS_FINE_LOCATION, ACCESS_BACKGROUN
자주 묻는 질문

서명 권한은 무엇인가요?

같은 개발자 키로 서명된 앱에만 부여되는 권한이며, 스킬은 이를 사용해 접근을 제한할 수 있습니다.

런타임 권한 팝업도 처리하나요?

네. Android 6.0 이상에서 위험한 권한에 대한 런타임 권한 흐름을 다룹니다.

추가 라이브러리가 필요한가요?

네. 스킬이 추가하는 코드에 일부 AndroidX 라이브러리가 필요하다고 알려 줍니다.

상세 정보

작성자의 원본 설명

Audits, detects gaps, and remediates Android permissions and IPC component security vulnerabilities. Use when reviewing AndroidManifest.xml, defining custom permissions, securing Services, Receivers, and Providers, verifying caller signatures and UID using Binder, or implementing runtime permission flows.

repo: android/skills

인기도

GitHub 스타
10k
순위
#11933
라이선스
Apache-2.0
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬