Make mutable implicit PendingIntent immutable
Starting from target SDK U, we will block creation of mutable PendingIntents with implicit Intents because attackers can mutate the Intent object within and launch altered behavior on behalf of victim apps. For more details on the vulnerability, see go/pendingintent-rca. From a quick analysis, we concluded that the PendingIntent here is only mutated with flags from fillInIntent, so we added them to the intent inside and made the PendingIntent immutable. Reviewers, please call out if this is not the case. Bug: 236704164 Bug: 229362273 Test: CtsVerifier: Bubble Notification Tests Test: atest frameworks/base/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles Change-Id: Idda5868f193070908afd435cedac72a03b6c4439
This commit is contained in:
@@ -232,10 +232,13 @@ public class BubbleExpandedView extends LinearLayout {
|
||||
|
||||
if (mBubble.isAppBubble()) {
|
||||
PendingIntent pi = PendingIntent.getActivity(mContext, 0,
|
||||
mBubble.getAppBubbleIntent(),
|
||||
PendingIntent.FLAG_MUTABLE,
|
||||
mBubble.getAppBubbleIntent()
|
||||
.addFlags(FLAG_ACTIVITY_NEW_DOCUMENT)
|
||||
.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK),
|
||||
PendingIntent.FLAG_IMMUTABLE,
|
||||
null);
|
||||
mTaskView.startActivity(pi, fillInIntent, options, launchBounds);
|
||||
mTaskView.startActivity(pi, /* fillInIntent= */ null, options,
|
||||
launchBounds);
|
||||
} else if (!mIsOverflow && mBubble.hasMetadataShortcutId()) {
|
||||
options.setApplyActivityFlagsForBubbles(true);
|
||||
mTaskView.startShortcutActivity(mBubble.getShortcutInfo(),
|
||||
|
||||
Reference in New Issue
Block a user