Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7e7a6b2 authored by Carlos Valdivia's avatar Carlos Valdivia Committed by android-build-merger
Browse files

Merge "[Security] Prevent malicious notifications from AMS." into nyc-dev

am: c118e620

* commit 'c118e620':
  [Security] Prevent malicious notifications from AMS.

Change-Id: I55046f06652b37702f48d7e36b121e893e9ffe5f
parents cc72e549 c118e620
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -2237,8 +2237,13 @@ public class AccountManagerService
                }
            }

            new Session(accounts, response, account.type, expectActivityLaunch,
                    false /* stripAuthTokenFromResult */, account.name,
            new Session(
                    accounts,
                    response,
                    account.type,
                    expectActivityLaunch,
                    false /* stripAuthTokenFromResult */,
                    account.name,
                    false /* authDetailsRequired */) {
                @Override
                protected String toDebugString(long now) {
@@ -2310,6 +2315,15 @@ public class AccountManagerService

                        Intent intent = result.getParcelable(AccountManager.KEY_INTENT);
                        if (intent != null && notifyOnAuthFailure && !customTokens) {
                            /*
                             * Make sure that the supplied intent is owned by the authenticator
                             * giving it to the system. Otherwise a malicious authenticator could
                             * have users launching arbitrary activities by tricking users to
                             * interact with malicious notifications.
                             */
                            checkKeyIntent(
                                    Binder.getCallingUid(),
                                    intent);
                            doNotification(mAccounts,
                                    account, result.getString(AccountManager.KEY_AUTH_FAILED_MESSAGE),
                                    intent, accounts.userId);