Commit Graph

340080 Commits

Author SHA1 Message Date
TreeHugger Robot
f4a729180c Merge "Only allow BROWSABLE && DEFAULT Intents to be always opened" into oc-mr1-dev 2021-01-28 21:33:04 +00:00
Rob Carr
e3f7644490 Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into oc-mr1-dev 2021-01-26 19:27:37 +00:00
Winson
2565d0b3a1 Only allow BROWSABLE && DEFAULT Intents to be always opened
Auto verification of app links requires that an intent filter declare
action=VIEW, scheme=HTTP(S), category=BROWSABLE. However,
PackageManagerService was not taking that into account, missing the
category requirement.

But the app info Settings UI did take category into account, so it was
possible for a user to set an application to automatically open web URIs
without understanding that this also granted domains that were not
visible in the app info UI.

To resolve both this, this change makes it so that both auto
verification and the Settings state can only consider the app as
"always" open only if the Intent contains both BROWSABLE and DEFAULT.

Bug: 175139501
Bug: 175319005

Test: manual, see bug for reproduction steps

Merged-In: Ib957258735893bf2779bed19bd400c6726ee6478
Change-Id: Ib957258735893bf2779bed19bd400c6726ee6478
(cherry picked from commit 4266f938c6)
2021-01-12 16:48:38 +00:00
Robert Carr
9661bf7a40 DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window
without an input channel. Unfortunately in releases prior to Android R
this would allow creation of a Window which will not be known to the
InputDispatcher at all. This means that the logic generating
FLAG_OBSCURED will work and a window will be able to overlay another
window without the overlayed window being notified. In Android R and
later this isn't a problem as the InputDispatcher is informed of all
windows, input channel or not. For past Android releases, this patch
disables NO_INPUT_CHANNEL for use outside of the WM.

Bug: 152064592
Test: Existing tests pass
Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
2020-12-14 18:32:56 +00:00
Dmitry Dementyev
fedbadf57e Protect account chooser activities against overlay.
Bug: 172841550
Test: manual
Merged-In: I1a16808426934f4a8d12410576d769443e4c2a04
Merged-In: I3cd5a94386f15cf60a7fe3095b00815e4a6485ae
Change-Id: I35dc86b5721a4531447a6d99d6c30f23543130cb
2020-12-14 09:09:18 -08:00
Winson Chiu
2d22fe6eec [automerger skipped] Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into oc-dev am: e9954e149f am: b070447e39 -s ours
am skip reason: Change-Id Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6 with SHA-1 4e71b31e0c is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940358

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I346236b82b70e9f4c72648b71b33e22fc1956bf0
2020-12-08 01:03:38 +00:00
Winson Chiu
b070447e39 Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into oc-dev am: e9954e149f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940358

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1e138583f75173a4d785707fa5fa4320c986a1d2
2020-12-08 00:46:04 +00:00
Winson Chiu
9109ce178e Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into oc-mr1-dev 2020-12-08 00:26:44 +00:00
Winson Chiu
e9954e149f Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into oc-dev 2020-12-08 00:26:38 +00:00
TreeHugger Robot
9064940495 Merge "Revoke the uri permission when the file is deleted" into oc-mr1-dev 2020-12-03 08:05:44 +00:00
Varun Shah
79062d7903 RESTRICT AUTOMERGE
Ensure caller identity is restored in CP quick-path.

Bug: 172935267
Test: PoC in bug
Change-Id: I469bde7d0a0f89c94f1234cf40983395048962e2
2020-11-23 14:24:23 -08:00
Dmitry Dementyev
f312c9e864 Protect GrantCredentialsPermissionActivity against overlay. am: deddb784d0 am: 21e36702cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13021294

Change-Id: I3fe44a233948b572499797f954c304ab40d02f35
2020-11-11 14:23:35 +00:00
Dmitry Dementyev
21e36702cd Protect GrantCredentialsPermissionActivity against overlay. am: deddb784d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13021294

Change-Id: I37e60418b8f67f3223692d370ced45aae46a706f
2020-11-11 14:02:42 +00:00
Dmitry Dementyev
deddb784d0 Protect GrantCredentialsPermissionActivity against overlay.
Bug: 169763814
Test: manual
Merged-In: I15dd22791fcc61ef02b06ad51d9e4409d11c0181
Change-Id: I0d8f901d100a5e2a022c96fa6c2be75a11c58059
2020-11-10 20:48:09 +00:00
TreeHugger Robot
e0efbc5fbb Merge "Check that Account Parcel has name and type." into oc-dev am: 3349eaa9e8 am: 01f2d401c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12999920

Change-Id: I0e4803e7aafd730b9e21e49dc350ee51eedf42d8
2020-11-10 19:56:49 +00:00
TreeHugger Robot
01f2d401c9 Merge "Check that Account Parcel has name and type." into oc-dev am: 3349eaa9e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12999920

Change-Id: Id4c8eb30ffbe0886360dcd3bde1ada4f08ffdefa
2020-11-10 19:40:01 +00:00
TreeHugger Robot
3349eaa9e8 Merge "Check that Account Parcel has name and type." into oc-dev 2020-11-10 19:22:49 +00:00
Curtis Belmonte
e422433ae5 [automerger skipped] Merge "DO NOT MERGE Check fingerprint client against top activity in auth callback" into oc-dev am: 4cf0088dee am: a10d4f4317 -s ours
am skip reason: Change-Id I0707c3f55eaf2a69c6625a3ceb3b5626b3676b26 with SHA-1 7786f4908f is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12769285

Change-Id: I43d39fd10853543d296e024b3464fca66f6b34eb
2020-11-09 23:39:07 +00:00
Curtis Belmonte
efa94e557f [automerger skipped] DO NOT MERGE Check fingerprint client against top activity in auth callback am: bb5706541d am: bfd504c81a -s ours
am skip reason: Change-Id I0707c3f55eaf2a69c6625a3ceb3b5626b3676b26 with SHA-1 7786f4908f is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12769285

Change-Id: I3997d0b923b8e52b1bc0c0cc474b35f5b65525be
2020-11-09 23:39:04 +00:00
Miranda Kephart
a4fbde5687 Merge "[DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable" into oc-dev am: d15b2f5bce am: 0d82d9ffc9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12773217

Change-Id: Ie068c0cc838f65a20ab224a3c218ee8221e9f700
2020-11-09 23:38:54 +00:00
Miranda Kephart
368eecbec0 [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable am: 441247985a am: 40297a24eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12773217

Change-Id: I6627407f13c27260f35c3b732390a9d5e2baaed1
2020-11-09 23:38:46 +00:00
Curtis Belmonte
a10d4f4317 Merge "DO NOT MERGE Check fingerprint client against top activity in auth callback" into oc-dev am: 4cf0088dee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12769285

Change-Id: I5f5fb3974e2912c7b9e7834f98cb7c20daac9fa3
2020-11-09 23:29:37 +00:00
Curtis Belmonte
bfd504c81a DO NOT MERGE Check fingerprint client against top activity in auth callback am: bb5706541d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12769285

Change-Id: I732e5a1c826f728b683078884e02b0756ae59ae2
2020-11-09 23:29:34 +00:00
Miranda Kephart
0d82d9ffc9 Merge "[DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable" into oc-dev am: d15b2f5bce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12773217

Change-Id: I56aea4db33904c98006278873273f98963e9e7ce
2020-11-09 23:27:13 +00:00
Miranda Kephart
40297a24eb [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable am: 441247985a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12773217

Change-Id: I070580ecb1be0ff94e4940487f3d68e04149b862
2020-11-09 23:27:10 +00:00
Curtis Belmonte
4cf0088dee Merge "DO NOT MERGE Check fingerprint client against top activity in auth callback" into oc-dev 2020-11-09 21:36:29 +00:00
Curtis Belmonte
1a673296ae Merge "DO NOT MERGE Check fingerprint client against top activity in auth callback" into oc-mr1-dev 2020-11-09 21:36:29 +00:00
Miranda Kephart
d15b2f5bce Merge "[DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable" into oc-dev 2020-11-09 21:01:50 +00:00
Miranda Kephart
09b6ab6bdf Merge "[DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable" into oc-mr1-dev 2020-11-09 18:28:56 +00:00
Philip P. Moltmann
37beb3172b Merge changes from topic "12940341" into oc-dev am: a9a03ae669 am: b172aaf747
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12987876

Change-Id: I90e00bb137edc75878d99f849631db40cd7ffa17
2020-11-09 18:04:05 +00:00
Philip P. Moltmann
b2152f32f4 Ensure permissions are revoked on state changes am: 3dfb544626 am: ebfe073540
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940341

Change-Id: I8abf9d6c3d9014bad2a24a2276b9747ac04ff970
2020-11-09 18:03:57 +00:00
Philip P. Moltmann
b172aaf747 Merge changes from topic "12940341" into oc-dev am: a9a03ae669
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12987876

Change-Id: I8c63d7910a37c7c994611ac7c6c19d1e1f6bdc94
2020-11-09 17:28:33 +00:00
Philip P. Moltmann
ebfe073540 Ensure permissions are revoked on state changes am: 3dfb544626
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940341

Change-Id: Ib991fcf4d56b6bd0fd0e7e0c4d6ebce2f7601ee2
2020-11-09 17:28:24 +00:00
Philip P. Moltmann
a9a03ae669 Merge changes from topic "12940341" into oc-dev
* changes:
  Revoke permission on non-runtime -> runtime upgrade
  Ensure permissions are revoked on state changes
2020-11-09 16:50:06 +00:00
Miranda Kephart
3aa7d375b2 [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable
Mutable pending intents are a security risk. This change adds the
IMMUTABLE flag to all PendingIntents created in GlobalScreenshot.

Bug: 162738636
Test: manual
Change-Id: I1044b6aaf2b1650ff91d9a72181684d2aaea9a62
2020-11-09 16:08:57 +00:00
Miranda Kephart
441247985a [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable
Mutable pending intents are a security risk. This change adds the
IMMUTABLE flag to all PendingIntents created in GlobalScreenshot.

Bug: 162738636
Test: manual
Change-Id: I1044b6aaf2b1650ff91d9a72181684d2aaea9a62
2020-11-09 16:08:23 +00:00
Dmitry Dementyev
2d868147e4 Ignore GrantCredentials call with unexpected calling uid. am: 88787b77a0 am: 2e5fe473e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940344

Change-Id: Id30e803ed372bff60a3242a1667c5bd52cb12728
2020-11-06 22:52:46 +00:00
Dmitry Dementyev
2e5fe473e1 Ignore GrantCredentials call with unexpected calling uid. am: 88787b77a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940344

Change-Id: I87590ebfc45dea9c8a9d0ad46882ef03eb8fd5b9
2020-11-06 22:04:03 +00:00
Dmitry Dementyev
88787b77a0 Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Merged-In: I983fa
Change-Id: I8da362df269decd7c3930a2387f42e09796e732f
2020-11-06 19:34:05 +00:00
Dmitry Dementyev
0992000ace Check that Account Parcel has name and type.
Bug: 129287265
Test: manual
Change-Id: I8431eb27cc4c6dfd3048b28ff635474f14433308
(cherry picked from commit 32e8579638)
2020-11-06 00:37:40 +00:00
Eugene Susla
2c54e6259a RESTRICT AUTOMERGE am: e8551a88f6 am: 6b6c135380
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12950101

Change-Id: I2d4bc8b16fe0a709a8a4560a4e685e98c89e570d
2020-11-05 20:45:37 +00:00
Eugene Susla
6b6c135380 RESTRICT AUTOMERGE am: e8551a88f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12950101

Change-Id: Ia5e5c97d0b564f8af1c870b8fdf5045e55b87076
2020-11-05 20:27:27 +00:00
Philip P. Moltmann
3dfb544626 Ensure permissions are revoked on state changes
If a permission owner changes, or a permission level is upgraded, revoke
the permission from all packages

Test: Manual
Bug: 154505240
Merged-In: I0dec9eb7c2fecd3147e33e04d3f79f6dffcf7721
Change-Id: I2b3780ba3ae5147026d4c85b3526fe1807724be6
(manually backported from commit a28931a098)
2020-11-04 13:19:00 -08:00
Philip P. Moltmann
dd6911cd57 Revoke permission on non-runtime -> runtime upgrade
Not only on normal -> runtime.

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases --test android.appsecurity.cts.PermissionsHostTest#testNoPermissionEscalationAfterReboot
Bug: 154505240, 168319670
Change-Id: If3b420067b4d7111dcf67ae6f98e42176158b679
Merged-In: If3b420067b4d7111dcf67ae6f98e42176158b679
2020-11-04 13:19:00 -08:00
Eugene Susla
e8551a88f6 RESTRICT AUTOMERGE
Fix CDM package check

CDM was using a pckage check that returns a value intead of throwing,
resulting in failing to throw on querying other package's associations

Test: ensure attached bug no longer reproduces
Bug: 167244818
Change-Id: I21319b6f5495dcae681541c76b847aad0c00b8ab
2020-10-29 11:40:29 -07:00
Winson
4e71b31e0c Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:57:54 +00:00
Winson
4252eb85d8 Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:57:22 +00:00
TreeHugger Robot
83739b6db9 Merge "Fix storing the wrong value of mLockdown in setting" into oc-mr1-dev 2020-10-08 03:40:59 +00:00
David Su
d840f0c7da [automerger skipped] RESTRICT AUTOMERGE Implement sendBroadcastAsUserMultiplePermissions in BridgeContext. am: 752cb249a6 -s ours am: 816fd66d64 -s ours
am skip reason: Change-Id I857ea00cc58a0abbb77960643f361dd6dd9c8b56 with SHA-1 e57c25a451 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12779618

Change-Id: Idefd4af0be5dce2baf988135f3062029749dc95b
2020-10-08 00:24:07 +00:00
David Su
816fd66d64 [automerger skipped] RESTRICT AUTOMERGE Implement sendBroadcastAsUserMultiplePermissions in BridgeContext. am: 752cb249a6 -s ours
am skip reason: Change-Id I857ea00cc58a0abbb77960643f361dd6dd9c8b56 with SHA-1 e57c25a451 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12779618

Change-Id: I19aeca326d6f4faae382fb6a140acde81602eb3a
2020-10-08 00:11:38 +00:00