Commit Graph

33908 Commits

Author SHA1 Message Date
Curtis Belmonte
7786f4908f DO NOT MERGE Check fingerprint client against top activity in auth callback
Due to a race condition with activity task stack broadcasts, it's
currently possible for fingerprint authentication to succeed for a
non-top activity. This means, for example, that a malicious overlay
could be drawn in order to mislead the user about what they are
authenticating for.

This commit addresses the issue by adding a check to the fingerprint
authentication client interface that ensures the authenticating
activity is on top at the time of authentication. Otherwise, the
pending authentication will fail, as if an incorrect biometric
been presented.

Test: Follow steps from b/159249069:
1. Install com.pro100svitlo.fingerprintauthdemo from the Play store.
2. Install the PoC attack app from b/159249069.
3. Start the PoC attack app and press the "Launch PoC attack" button.
4. Use fingerprint to authenticate while the overlay is showing.

Before: Authentication succeeds, and a new activity is launched.
After: Authentication fails, and no new activity is launched.

Bug: 159249069
Change-Id: I0707c3f55eaf2a69c6625a3ceb3b5626b3676b26
Merged-In: If5cdf8ffaf3aa7d8a1ac81272e3bfb2cc7cdddf1
Merged-In: Iee6af379515385777984da55048c1efd9339ed88
Merged-In: I9b242a9fee0acbfb430875061e2d809c00fe4b97
Merged-In: I1241a12eafa0bdbac59a8ddd4cf6a0637d467b19
Merged-In: Ie5a0f8c3e9b92d348a78678a6ed192d440c45ffc
Merged-In: I289d67e5c7055ed60f7a96725c523d07cd047b23
2020-10-06 16:05:20 -07:00
Hai Zhang
043a322e4d DO NOT MERGE Don't allow non-instant permissions for instant apps. am: a710a30457 am: ea36a0c236
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12366889

Change-Id: Id791215e99e121b996892c5c06d9a54a5b7f691d
2020-08-29 01:21:46 +00:00
Hai Zhang
ea36a0c236 DO NOT MERGE Don't allow non-instant permissions for instant apps. am: a710a30457
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12366889

Change-Id: Iab47aca559ae8c13a26507827aadfc0c8b239d74
2020-08-29 01:09:22 +00:00
Hai Zhang
a710a30457 DO NOT MERGE Don't allow non-instant permissions for instant apps.
Bug: 140256621
Test: atest EphemeralTest
Change-Id: Id07342c0347c0b4d2ccb3f58a4af9fda7a20d6ef
2020-08-17 07:40:45 +00:00
Patrick Baumann
929ab61a14 RESTRICT AUTOMERGE
Do not set referrerUri on SessionInfo for non-owners

This change leaves the referrerUri field null when the caller leading to
its production is not the owner of the session.

Bug: 142125338
Test: Manual via test app in related bug
Change-Id: I84679ea0636aa2097e25e23813c48134c9cc1d75
2020-07-31 16:55:24 +00:00
TreeHugger Robot
ef301aba3e Merge "Add missing isShellUser check" into oc-dev am: adc8f21ad1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099340

Change-Id: Ie74d2561c45785dddc65efc46902a368c8a35736
2020-07-31 05:32:49 +00:00
John Reck
5e2931c656 Add missing isShellUser check
Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 0354261197)
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
2020-07-18 00:32:45 +00:00
John Reck
3a5cd5bbe3 Add missing isShellUser check
Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 0354261197)
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
2020-07-18 00:32:37 +00:00
Christopher Tate
c41fdb42a4 DO NOT MERGE - Only autoVerify at install for new hosts am: 90b716a442
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11689886

Change-Id: I8ff3f48cfd11d3e1a5510a5a93e3f820a84a33b8
2020-06-26 16:36:25 +00:00
Chris Tate
1747090bf8 Merge "DO NOT MERGE - Only autoVerify at install for new hosts" into oc-dev 2020-06-26 16:24:08 +00:00
Chris Tate
178b57c5c5 Merge "Only autoVerify at install for new hosts" into oc-mr1-dev 2020-06-25 23:41:35 +00:00
Chris Tate
239ab1c9d6 Merge "More fixes towards the race conditions in AMS" into oc-mr1-dev 2020-06-03 22:09:12 +00:00
Winson
0ce3ba0c26 DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package am: fc8bfed553
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11384837

Change-Id: I42a87fe06a2634d5fd40119ef46d71a99e147f50
2020-06-03 18:49:15 +00:00
Winson Chiu
a567c14f22 Merge "DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package" into oc-mr1-dev 2020-06-03 18:34:31 +00:00
Winson Chiu
c842acc15a Merge "DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package" into oc-dev 2020-06-03 18:34:30 +00:00
Christopher Tate
90b716a442 DO NOT MERGE - Only autoVerify at install for new hosts
Re-run app link verification at update time only when the set of hosts
has expanded.  Intentionally revoke verify history when an app stops
using autoVerify, as a one-time measure to place it back into the
non-autoverify model for tracking the user's launch preferences.  If the
app starts using autoVerify again later, it behaves identically to an
app that has never done so before.

Bug: 151475497
Bug: 146204120
Test: described on master CL

Merged-In: I200d85085ce79842a3ed39377d1f75ec381c8991
Merged-In: Ibaf087946966ad82d60c7b255e3ee75990716b63
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
2020-06-03 17:48:30 +00:00
Linus Tufvesson
c2a8913cf0 RESTRICT AUTOMERGE am: 78fe3b0aa2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11375232

Change-Id: I38516ab9216169c555e702947a5448c142648c90
2020-06-03 11:35:02 +00:00
TreeHugger Robot
2688770c06 Merge "RESTRICT AUTOMERGE" into oc-dev 2020-06-03 11:15:08 +00:00
TreeHugger Robot
b539388631 Merge "RESTRICT AUTOMERGE" into oc-mr1-dev 2020-06-03 11:09:39 +00:00
Christopher Tate
153de338c1 Only autoVerify at install for new hosts
Re-run app link verification at update time only when the set of hosts
has expanded.  Intentionally revoke verify history when an app stops
using autoVerify, as a one-time measure to place it back into the
non-autoverify model for tracking the user's launch preferences.  If the
app starts using autoVerify again later, it behaves identically to an
app that has never done so before.

Bug: 151475497
Bug: 146204120
Test: described on master CL

Merged-In: I200d85085ce79842a3ed39377d1f75ec381c8991
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
2020-06-02 04:12:00 +00:00
Jing Ji
9450069de9 More fixes towards the race conditions in AMS
Bug: 142986887
Bug: 140108616
Test: Manual
Change-Id: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
Merged-In: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
(cherry picked from commit b2e84f0406)
2020-05-26 22:04:59 +00:00
Winson
40ca8b51fa DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
2020-05-21 17:17:53 +00:00
Winson
fc8bfed553 DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
2020-05-21 17:15:11 +00:00
lumark
748bcb047c [RESTRICT AUTOMERGE] Restrict app transition maximum duration am: 36bcc77337 am: dcc38988ee
Change-Id: Ied1793dbc8d7b58170e22729aa351c582c894ffa
2020-05-05 21:32:53 +00:00
lumark
dcc38988ee [RESTRICT AUTOMERGE] Restrict app transition maximum duration am: 36bcc77337
Change-Id: Ia049c055935fdc0ceb0369cf131e7d166e5522f6
2020-05-05 21:04:59 +00:00
Bryan Ferris
6255311d39 Merge "[RESTRICT AUTOMERGE] Restrict app transition maximum duration" into oc-dev 2020-05-05 20:49:41 +00:00
Linus Tufvesson
2bf126d042 RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: cts-tradefed run cts -m CtsDisplayTestCases -t android.display.cts.VirtualDisplayTest
Test: Manually verfied that presentations are blocked on main display
Change-Id: I67c79c84ec2adfcdaf3b0f7bc7f0f41d30618e85
2020-05-05 18:55:09 +01:00
Linus Tufvesson
78fe3b0aa2 RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: cts-tradefed run cts -m CtsDisplayTestCases -t android.display.cts.VirtualDisplayTest
Test: Manually verfied that presentations are blocked on main display

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-05 18:48:20 +01:00
Chris Tate
6da62f7e0e Merge "Verify all possible hosts that match web nav" into oc-dev am: 0d01b03776
Change-Id: I81ea478e735c5c3d571835a99edb1547885d76ab
2020-04-07 17:52:30 +00:00
Chris Tate
097d107125 Merge "Verify all possible hosts that match web nav" into oc-mr1-dev 2020-04-07 17:40:31 +00:00
Chris Tate
0d01b03776 Merge "Verify all possible hosts that match web nav" into oc-dev 2020-04-07 17:40:04 +00:00
Linus Tufvesson
d903a3ef4c RESTRICT AUTOMERGE am: 59ba151854
Change-Id: Ic48f81f9259cb5bb2a3af3befcd5ef9a630c4766
2020-04-03 09:44:26 +00:00
Linus Tufvesson
0c6de1676d Merge "RESTRICT AUTOMERGE" into oc-mr1-dev 2020-04-03 09:27:20 +00:00
Linus Tufvesson
55dcec46fb Merge "RESTRICT AUTOMERGE" into oc-dev 2020-04-03 09:27:08 +00:00
Linus Tufvesson
59ba151854 RESTRICT AUTOMERGE
This reverts commit 0bb93d4b1c.

Reason for revert: Breaks apps using Presentation in combination with private virtual displays

Bug: 141745510
Change-Id: I6673946137d6b12fa725e6df1c936068dedc3787
2020-04-01 13:31:51 +00:00
Linus Tufvesson
41215b67a3 RESTRICT AUTOMERGE
This reverts commit 7d4adf4d46.

Reason for revert: Breaks apps using Presentation in combination with private virtual displays

Bug: 141745510
Change-Id: I15ded4f1a7cf152e331c853c128c91db173f3cd7
2020-04-01 13:31:34 +00:00
lumark
36bcc77337 [RESTRICT AUTOMERGE] Restrict app transition maximum duration
As WindowState#startAnimation for restricting window animation duration
(currently is 10 secs),

For security reason, we also need to restrict app transition animation
duration as 3 secs to prevent malicious app may set a long duration or
infinity repeat counts through ActivityOption#makeCustomAnimation or
Activity#overridePendingTransition with custom animation set.

Bug: 145728687
Test: manual as issue provided test app
Change-Id: I39051d6e4d2b681ce2becbafe14aab3f3d8ebf6b
2020-03-31 23:38:36 +00:00
Christopher Tate
a481c86cd3 Verify all possible hosts that match web nav
Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f897f)
2020-03-31 18:01:21 +00:00
Christopher Tate
18e46e36eb Verify all possible hosts that match web nav
Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f897f)
2020-03-31 17:56:29 +00:00
TreeHugger Robot
6d992d651b Merge "Revert "Revoke 'always' web handler status when not autoverifying"" into oc-dev am: 41d1927c3f am: 3e2270de45
Change-Id: I43f76e0d351518960a01ce71419680d21714c9b6
2020-03-30 20:32:57 +00:00
TreeHugger Robot
3e2270de45 Merge "Revert "Revoke 'always' web handler status when not autoverifying"" into oc-dev am: 41d1927c3f
Change-Id: Ia488fcc0dd49b8262246d41c24b61dc59b8e35bf
2020-03-30 20:09:34 +00:00
TreeHugger Robot
41d1927c3f Merge "Revert "Revoke 'always' web handler status when not autoverifying"" into oc-dev 2020-03-30 19:55:03 +00:00
Chris Tate
92561d210d Revert "Revoke 'always' web handler status when not autoverifying"
This reverts commit 6cf5f92825.

Reason for revert: Inadvertently broke link handling stickiness even for well behaved apps

Bug: 146204120
Test: install app that handles web urls; set to 'always' in Settings;
install same apk again.  Verify that app is still in 'always' state via
'adb shell dumpsys package d'

Merged-In: I2b108064794b961904811c5d9f54c37dd2c7f482
Merged-In: If9046cb420961b8ef0333e9f1115eb69fb92242e
Change-Id: I03a121c0c1284c965bb87ee426eb0376681cf7d8
2020-03-30 17:51:18 +00:00
Automerger Merge Worker
2e254bb81e RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo am: 1c9bf5cc54
Change-Id: Ie38d9bf7ac60dd60a2dc1d0aef798ddc01fe19f7
2020-03-11 09:07:05 +00:00
TreeHugger Robot
6c1414ffac Merge "RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo" into oc-dev 2020-03-11 08:53:52 +00:00
Riddle Hsu
1c9bf5cc54 RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.

Also forbid attaching null application thread to avoid unexpected state
in process record.

Bug: 144285917
Test: bit FrameworksServicesTests:ActivityStackTests
Test: bit CtsSecurityTestCases:ActivityManagerTest# \
      testActivityManager_attachNullApplication
Merged-In: I60732f430256d37cb926d08d093581f051c4afed
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
2020-03-11 06:28:55 +00:00
Automerger Merge Worker
d6f71caed5 RESTRICT AUTOMERGE am: 0bb93d4b1c
Change-Id: I7569bed67b835e6f9e86ca2b0dc1b3e6309545c7
2020-03-11 05:08:32 +00:00
TreeHugger Robot
3e2869e2c0 Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into oc-mr1-dev 2020-03-11 04:53:42 +00:00
TreeHugger Robot
133e0a7eea Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into oc-dev 2020-03-11 04:53:16 +00:00
Automerger Merge Worker
0d8b222051 RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities am: 2be3ba4973
Change-Id: I3429cb8f1ecd7e211ebee8ef3b739d9d4342fdad
2020-03-10 21:01:51 +00:00