android:exported
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
קטגוריית OWASP: MASVS-PLATFORM: Platform Interaction
סקירה כללית
android:exported
המאפיין קובע אם רכיב (פעילות, שירות, מקלט שידור וכו') יכול להיות מופעל על ידי רכיבים של אפליקציות אחרות:
- אם
true
, כל אפליקציה יכולה לגשת לפעילות ולהפעיל אותה לפי שם המחלקה המדויק שלה.
- אם
false
, רק רכיבים של אותה אפליקציה, אפליקציות עם אותו מזהה משתמש או רכיבי מערכת עם הרשאות יכולים להפעיל את הפעילות.
הלוגיקה שמאחורי ערך ברירת המחדל של המאפיין הזה השתנתה לאורך זמן, והייתה שונה בהתאם לסוגי הרכיבים ולגרסאות Android. לדוגמה, ברמת API 16 (Android 4.1.1) ומטה, הערך של רכיבי <provider>
מוגדר כ-true
כברירת מחדל. אם לא מגדירים את המאפיין הזה באופן מפורש, יש סיכון שערכי ברירת המחדל יהיו שונים במכשירים מסוימים.
השפעה
המצב שבו יש ערכי ברירת מחדל שונים עלול לגרום לחשיפה לא מכוונת של רכיבים פנימיים באפליקציה. דוגמאות להשלכות אפשריות:
התקפות מניעת שירות (DoS).
אפליקציות אחרות ניגשות באופן לא הולם לרכיבים פנימיים כדי לשנות את הפונקציונליות הפנימית של האפליקציה שלכם.
הדלפה של מידע אישי רגיש.
ביצוע קוד בהקשר של האפליקציה הפגיעה.
אמצעי צמצום סיכונים
תמיד צריך להגדיר במפורש את המאפיין android:exported
. כך לא יהיה מקום לפרשנות, ותוכלו לציין בבירור את הכוונה שלכם לגבי הנראות של רכיב מסוים.
מומלץ עבורך
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון 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)"]]