android:exported
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
OWASP 카테고리: MASVS-PLATFORM: 플랫폼 상호작용
개요
android:exported
속성은 다른 애플리케이션의 구성요소에서 실행할 수 있는 구성요소(활동, 서비스, broadcast receiver 등)인지를 설정합니다.
true
인 경우 모든 앱이 활동에 액세스할 수 있고 활동의 정확한 클래스 이름으로 활동을 실행할 수 있습니다.
false
인 경우 같은 애플리케이션에 있는 구성요소나 동일한 사용자 ID를 가진 애플리케이션 또는 권한이 있는 시스템 구성요소만 활동을 실행할 수 있습니다.
이 속성의 기본값에 관한 로직은 시간이 지남에 따라 변경되었으며 구성요소 유형과 Android 버전에 따라 달랐습니다. 예를 들어 API 수준 16(Android 4.1.1) 이하에서는 <provider>
요소의 값이 기본적으로 true
로 설정됩니다. 이 속성을 명시적으로 설정하지 않으면 기기 간에 서로 다른 기본값을 사용할 위험이 있습니다.
영향
기본값이 다른 상황에서는 실수로 내부 애플리케이션 구성요소를 노출할 수 있습니다. 그 결과를 보여주는 예는 다음과 같습니다.
서비스 거부 공격,
앱의 내부 기능을 수정하기 위해 내부 구성요소에 부적절하게 액세스하는 다른 앱,
민감한 정보 유출,
취약한 애플리케이션 컨텍스트에서 코드 실행
완화 조치
항상 android:exported
속성을 명시적으로 설정하세요. 이렇게 하면 해석할 여지가 없어 구성요소의 공개 상태와 관련된 개발자의 의도를 명확하게 알 수 있습니다.
맞춤 콘텐츠
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-12-08(UTC)
[null,null,["최종 업데이트: 2023-12-08(UTC)"],[],[],null,["# android:exported\n\n\u003cbr /\u003e\n\n**OWASP category:** [MASVS-PLATFORM: Platform Interaction](https://mas.owasp.org/MASVS/09-MASVS-PLATFORM)\n\nOverview\n--------\n\nThe `android:exported` [attribute](/guide/topics/manifest/activity-element#exported) sets whether a component (activity, service, broadcast receiver, etc.) can be launched by components of other applications:\n\n- If `true`, any app can access the activity and launch it by its exact class name.\n- If `false`, only components of the same application, applications with the same user ID, or privileged system components can launch the activity.\n\nThe logic behind the default value of this attribute changed over time and was different depending on the component types and Android versions. For example, on API level 16 (Android 4.1.1) or lower the value for `\u003cprovider\u003e` elements is set to `true` by default. Not setting this attribute explicitly carries the risk of having different default values between some devices.\n\nImpact\n------\n\nThe situation with different default values means you could accidentally expose internal application components. A few examples of the consequences could be the following:\n\nDenial of service attacks.\nOther apps inappropriately accessing internal components to modify your app's internal functionality.\nLeaking of sensitive data.\nCode execution in the context of the vulnerable application.\n\nMitigations\n-----------\n\nAlways explicitly set the `android:exported` attribute. This will leave no room for interpretation and clearly signal your intention with regard to a component's visibility.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [# Key management {:#key-management}](/topic/security/data)\n- [Run embedded DEX code directly from APK](/topic/security/dex)\n- [Tapjacking](/topic/security/risks/tapjacking)"]]