Commit Graph

63847 Commits

Author SHA1 Message Date
Edgar Wang
aeb36e5c28 Fix LaunchAnyWhere in AppRestrictionsFragment
If the intent's package equals to the app's package, this intent
will be allowed to startActivityForResult.
But this check is unsafe, because if the component of this intent
is set, the package field will just be ignored. So if we set the
component to any activity we like and set package to the app's
package, it will pass the assertSafeToStartCustomActivity check
and now we can launch anywhere.

Bug: 223578534
Test: robotest and manual verify
Change-Id: I40496105bae313fe5cff2a36dfe329c1e2b5bbe4
(cherry picked from commit 90e095dbe3)
2022-04-13 04:48:46 +00:00
Edgar Wang
b3eecdd13d Fix LaunchAnyWhere in AppRestrictionsFragment
If the intent's package equals to the app's package, this intent
will be allowed to startActivityForResult.
But this check is unsafe, because if the component of this intent
is set, the package field will just be ignored. So if we set the
component to any activity we like and set package to the app's
package, it will pass the assertSafeToStartCustomActivity check
and now we can launch anywhere.

Bug: 223578534
Test: robotest and manual verify
Change-Id: I40496105bae313fe5cff2a36dfe329c1e2b5bbe4
(cherry picked from commit 90e095dbe3)
2022-04-13 04:47:24 +00:00
Arc Wang
3fc5b81efe [automerger skipped] Merge "Hide non-system overlay window on ActivityPicker" into rvc-dev am: 91481f8a1f -s ours
am skip reason: Merged-In I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3 with SHA-1 c55b5b54d2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17628099

Change-Id: Ied0f1e36a2d67fa9681f60c89ce0748af48148b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-08 01:50:59 +00:00
Arc Wang
4bf19c2271 [automerger skipped] Hide non-system overlay window on ActivityPicker am: d10662cf97 -s ours
am skip reason: Merged-In I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3 with SHA-1 c55b5b54d2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17628099

Change-Id: Ib0ff605c1ed18d9053248dace8087fab90c3234c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-08 01:50:58 +00:00
Arc Wang
91481f8a1f Merge "Hide non-system overlay window on ActivityPicker" into rvc-dev 2022-04-08 01:19:01 +00:00
Arc Wang
346ab35fc4 [automerger skipped] Hide non-system overlay window on ActivityPicker am: c4121c15e4 am: 21a0db9882 am: e5e271bfed -s ours
am skip reason: Merged-In I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3 with SHA-1 c55b5b54d2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17628100

Change-Id: If996f3775f8de7981af3409129d8d5254b470b93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 20:05:45 +00:00
Arc Wang
e5e271bfed Hide non-system overlay window on ActivityPicker am: c4121c15e4 am: 21a0db9882
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17628100

Change-Id: Id6820351a67c2b2924a9a6ee3a06731519510ff7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 19:44:36 +00:00
Arc Wang
21a0db9882 Hide non-system overlay window on ActivityPicker am: c4121c15e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17628100

Change-Id: I54645a67488b6c155218eca6c5fb5779daabd495
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 19:15:23 +00:00
Arc Wang
c4121c15e4 Hide non-system overlay window on ActivityPicker
To improve security.

Bug: 181962311
Test: manual
      Show an AlertDialog and observe if it will hide after below command.
      adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker
Change-Id: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
Merged-In: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
2022-04-07 03:44:12 +00:00
Arc Wang
d10662cf97 Hide non-system overlay window on ActivityPicker
To improve security.

Bug: 181962311
Test: manual
      Show an AlertDialog and observe if it will hide after below command.
      adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker
Change-Id: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
Merged-In: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
2022-04-07 03:42:30 +00:00
Arc Wang
c55b5b54d2 Hide non-system overlay window on ActivityPicker
To improve security.

Bug: 181962311
Test: manual
      Show an AlertDialog and observe if it will hide after below command.
      adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker
Change-Id: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
Merged-In: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
2022-04-07 03:42:02 +00:00
Bonian Chen
8c89ac9027 [automerger skipped] Merge "[Settings] Move display of VPN version into summary text" into qt-dev am: d0888970a4 am: d35d3e2446 -s ours am: 961d4b26b7 -s ours
am skip reason: Merged-In I666b9db356feeebf04e3be688897c2d9110a5275 with SHA-1 dddd74a491 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16341975

Change-Id: I38b41e693d544fa9b44323f3b9d1d7a6c53690ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 01:15:26 +00:00
Bonian Chen
961d4b26b7 [automerger skipped] Merge "[Settings] Move display of VPN version into summary text" into qt-dev am: d0888970a4 am: d35d3e2446 -s ours
am skip reason: Merged-In I666b9db356feeebf04e3be688897c2d9110a5275 with SHA-1 dddd74a491 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16341975

Change-Id: I50b0f293bc021fe8f28fb1f10cb20bc93c75bcf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 00:45:39 +00:00
Bonian Chen
d35d3e2446 Merge "[Settings] Move display of VPN version into summary text" into qt-dev am: d0888970a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16341975

Change-Id: Iabf1f3d5b113e12ddfd1cfe1037a94fb4509e180
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 00:23:16 +00:00
Bonian Chen
e8097d4464 [automerger skipped] Merge "[Settings] Move display of VPN version into summary text" into rvc-dev am: d0d67e68a5 -s ours
am skip reason: Merged-In I666b9db356feeebf04e3be688897c2d9110a5275 with SHA-1 5fc0e6614d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16341974

Change-Id: Id3bd26debfc50e0b332695ffaf9f1fe1aca51feb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 00:22:44 +00:00
Bonian Chen
eefa7371ed [automerger skipped] [Settings] Move display of VPN version into summary text am: dddd74a491 -s ours
am skip reason: Merged-In I666b9db356feeebf04e3be688897c2d9110a5275 with SHA-1 5fc0e6614d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16341974

Change-Id: Ide4d80dc46e692c7664010e6ab2746be482dff5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 00:22:43 +00:00
Bonian Chen
6279d80f93 Merge "[Settings] Move display of VPN version into summary text" into rvc-qpr-dev 2022-04-07 00:08:23 +00:00
Bonian Chen
d0d67e68a5 Merge "[Settings] Move display of VPN version into summary text" into rvc-dev 2022-04-07 00:08:16 +00:00
Bonian Chen
d0888970a4 Merge "[Settings] Move display of VPN version into summary text" into qt-dev 2022-04-07 00:08:08 +00:00
TreeHugger Robot
0b507f0203 [conflict] Merge "Prevent exfiltration of system files via user image settings." into qt-dev am: 74ff164972 am: e6e739d8b0 am: ed29b05dcd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17540383

Change-Id: I03622a4803112de1f7b2f2fb3000b007444bc19b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 17:48:29 +00:00
TreeHugger Robot
ed29b05dcd [conflict] Merge "Prevent exfiltration of system files via user image settings." into qt-dev am: 74ff164972 am: e6e739d8b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17003629

Change-Id: I8bba0ed0611a7cef34b210e7e7553de70dbf9aa3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb
2022-04-01 16:13:50 +00:00
TreeHugger Robot
e6e739d8b0 Merge "Prevent exfiltration of system files via user image settings." into qt-dev am: 74ff164972
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17003629

Change-Id: I5ebae8947d883130b93c9a82d087656dab41498a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 12:58:31 +00:00
TreeHugger Robot
74ff164972 Merge "Prevent exfiltration of system files via user image settings." into qt-dev 2022-04-01 12:42:31 +00:00
lucaslin
652527b496 Hide private DNS settings UI in Guest mode am: 52e863b5a2 am: 2c1c76cd35 am: 14e88ca2f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17129063

Change-Id: I8d31577fb64d959949b1c2aed51e482cb54a57ac
2022-03-09 06:55:34 +00:00
lucaslin
14e88ca2f9 Hide private DNS settings UI in Guest mode am: 52e863b5a2 am: 2c1c76cd35
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17129063

Change-Id: I417c9687ae22749f428a902a01612c50cbf0e52c
2022-03-09 06:32:20 +00:00
lucaslin
2c1c76cd35 Hide private DNS settings UI in Guest mode am: 52e863b5a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17129063

Change-Id: I5fc7b5001299b8831a1dd9440b6e25dfaf6d8a98
2022-03-09 06:08:16 +00:00
lucaslin
52e863b5a2 Hide private DNS settings UI in Guest mode
Hide private DNS settings UI in Guest mode to prevent guest
users modifying global private DNS settings.

Bug: 206987762
Test: 1. make RunSettingsRoboTests \
         ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest
      2. Switch to Guest user and check if the private DNS UI is
         hidden or not.
Change-Id: Iebfb8684da3be32110decd9e8447dd07b1c40387
2022-03-09 02:54:12 +00:00
Oli Lan
8950a90024 Prevent exfiltration of system files via user image settings.
This is a backport of ag/17005706.

This adds mitigations to prevent system files being exfiltrated
via the settings content provider when a content URI is provided
as a chosen user image.

The mitigations are:

1) Copy the image to a new URI rather than the existing takePictureUri
prior to cropping.

2) Only allow a system handler to respond to the CROP intent.

Bug: 187702830
Test: build and check functionality
Change-Id: Ia6314b6810afb5efa0329f3eeaee9ccfff791966
Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb
2022-03-03 13:18:16 +00:00
Jack Yu
7093dea7f7 [automerger skipped] Do not let guest user disable secure nfc am: 4e543a38f6 am: 46bd9ba5a5 -s ours am: cd6ce52ea4 -s ours
am skip reason: Merged-In I7253f7f08fde04e30400a30d9a0d24f1ceff04b0 with SHA-1 a579ca7554 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691813

Change-Id: I186c750238d8f159b2d33e309c2aa9badf60ff64
2022-02-08 02:43:45 +00:00
Jack Yu
cd6ce52ea4 [automerger skipped] Do not let guest user disable secure nfc am: 4e543a38f6 am: 46bd9ba5a5 -s ours
am skip reason: Merged-In I7253f7f08fde04e30400a30d9a0d24f1ceff04b0 with SHA-1 a579ca7554 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691813

Change-Id: Ief5899b4af766d3d1c9283e4a5a4500ff66b9009
2022-02-08 02:30:37 +00:00
Jack Yu
46bd9ba5a5 Do not let guest user disable secure nfc am: 4e543a38f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691813

Change-Id: Iffe578c58bf2dcebda45b0b71dd901bd3e08be41
2022-02-08 02:15:55 +00:00
Jack Yu
4e543a38f6 Do not let guest user disable secure nfc
Bug: 209446496
Test: manual
Merged-In: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
Change-Id: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
(cherry picked from commit d9e3e6e4b1)
2022-02-02 17:44:55 +00:00
Jack Yu
1009054124 Do not let guest user disable secure nfc am: a579ca7554
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16691815

Change-Id: Ic68c6849bb65875aea6286d415c66ae8a9f57dfa
2022-01-28 22:19:10 +00:00
Jack Yu
a579ca7554 Do not let guest user disable secure nfc
Bug: 209446496
Test: manual
Merged-In: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
Change-Id: I7253f7f08fde04e30400a30d9a0d24f1ceff04b0
(cherry picked from commit d9e3e6e4b1)
2022-01-22 07:56:25 +00:00
TreeHugger Robot
02a19ec59d [automerger skipped] Merge "Add caller check to com.android.credentials.RESET" into rvc-dev am: 3f6a48a552 -s ours
am skip reason: Merged-In I9dfde586616d004befbee529f2ae842d22795065 with SHA-1 35e3d0c1b0 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16577204

Change-Id: I34d7fec987c297fbb846888d9cf187d0a0f7321c
2022-01-13 21:06:50 +00:00
TreeHugger Robot
3f6a48a552 Merge "Add caller check to com.android.credentials.RESET" into rvc-dev 2022-01-13 20:43:35 +00:00
TreeHugger Robot
d902f8c7d6 Merge "Add caller check to com.android.credentials.RESET" into qt-dev am: 50b65a168a am: 1ef5f42b54 am: f43f129dc0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16577205

Change-Id: I7080ca5b236b6dd34cfe66789ef1a141d3b735cb
2022-01-13 19:35:50 +00:00
TreeHugger Robot
f43f129dc0 Merge "Add caller check to com.android.credentials.RESET" into qt-dev am: 50b65a168a am: 1ef5f42b54
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16577205

Change-Id: Ibc94e102fc69e4e2052526e1ee000684c5d7724f
2022-01-13 19:18:08 +00:00
TreeHugger Robot
1ef5f42b54 Merge "Add caller check to com.android.credentials.RESET" into qt-dev am: 50b65a168a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16577205

Change-Id: I8dae6a8a3fd0ed7cde335ead1e4b760bb5a8d195
2022-01-13 19:04:05 +00:00
TreeHugger Robot
50b65a168a Merge "Add caller check to com.android.credentials.RESET" into qt-dev 2022-01-13 18:50:36 +00:00
Edgar Wang
9624c50ac3 [automerger skipped] Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment am: f57d75f127 am: c0d6987e06 -s ours am: 7f848f44b6 -s ours
am skip reason: Merged-In Iaa2d3a9497c3266babe0789961befc9776a4db7a with SHA-1 dc44d01a16 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16579585

Change-Id: I1f38d39b1da9d41bc9fbe5b9824bda7a3bcff77a
2022-01-13 07:21:11 +00:00
Edgar Wang
7f848f44b6 [automerger skipped] Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment am: f57d75f127 am: c0d6987e06 -s ours
am skip reason: Merged-In Iaa2d3a9497c3266babe0789961befc9776a4db7a with SHA-1 dc44d01a16 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16579585

Change-Id: I72f294f9e8817aa2a5d694dd870115322f1525ec
2022-01-13 07:09:00 +00:00
Edgar Wang
c0d6987e06 Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment am: f57d75f127
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16579585

Change-Id: Icd26ee5a31e0cc7e11edaf6c542b045ab3a7ff01
2022-01-13 06:50:30 +00:00
Edgar Wang
463624d522 [automerger skipped] Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment am: dc44d01a16 -s ours
am skip reason: Merged-In Iaa2d3a9497c3266babe0789961befc9776a4db7a with SHA-1 8e7cc8fa4d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16579586

Change-Id: I5e42a5a8939af57523b1691c5f525df746e94ac1
2022-01-13 05:39:53 +00:00
Alex Johnston
f8a1a563c7 Add caller check to com.android.credentials.RESET
* Only the Settings app can reset credentials
  via com.android.credentials.RESET.
* com.android.credentials.INSTALL should still be
  callable by CertInstaller.

Manual testing steps:
* Install certificate via Settings
* Verify unable to reset certificates via test app
  provided in the bug (app-debug.apk)
* Verify able to reset certificates via Settings
* Verify com.android.credentials.INSTALL isn't changed

Bug: 200164168
Test: manual
Change-Id: I9dfde586616d004befbee529f2ae842d22795065
(cherry picked from commit 4c1272a921)
Merged-In: I9dfde586616d004befbee529f2ae842d22795065
2022-01-10 17:39:47 +00:00
Edgar Wang
8e7cc8fa4d Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment
In onReceive of AppRestrictionsFragment.java, there is a possible way to
start a phone call without permissions due to a confused deputy.
This could lead to local escalation of privilege with no additional
execution privileges needed.

We should not allow the restrictionsIntent to startActivity simply
because it resolves to multiple activities.
Instead, we should call resolveActivity and check the result's package
name is same as current package name, then it is safe to startActivity.

Bug: 200688991
Test: manual verify
Change-Id: Iaa2d3a9497c3266babe0789961befc9776a4db7a
Merged-In: Iaa2d3a9497c3266babe0789961befc9776a4db7a
(cherry picked from commit 359512cd95)
2022-01-07 04:24:28 +00:00
Edgar Wang
dc44d01a16 Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment
In onReceive of AppRestrictionsFragment.java, there is a possible way to
start a phone call without permissions due to a confused deputy.
This could lead to local escalation of privilege with no additional
execution privileges needed.

We should not allow the restrictionsIntent to startActivity simply
because it resolves to multiple activities.
Instead, we should call resolveActivity and check the result's package
name is same as current package name, then it is safe to startActivity.

Bug: 200688991
Test: manual verify
Change-Id: Iaa2d3a9497c3266babe0789961befc9776a4db7a
Merged-In: Iaa2d3a9497c3266babe0789961befc9776a4db7a
(cherry picked from commit 359512cd95)
2022-01-07 04:24:11 +00:00
Edgar Wang
f57d75f127 Fix bypass CALL_PRIVILEGED permission in AppRestrictionsFragment
In onReceive of AppRestrictionsFragment.java, there is a possible way to
start a phone call without permissions due to a confused deputy.
This could lead to local escalation of privilege with no additional
execution privileges needed.

We should not allow the restrictionsIntent to startActivity simply
because it resolves to multiple activities.
Instead, we should call resolveActivity and check the result's package
name is same as current package name, then it is safe to startActivity.

Bug: 200688991
Test: manual verify
Change-Id: Iaa2d3a9497c3266babe0789961befc9776a4db7a
Merged-In: Iaa2d3a9497c3266babe0789961befc9776a4db7a
(cherry picked from commit 359512cd95)
2022-01-07 04:23:50 +00:00
Alex Johnston
35e3d0c1b0 Add caller check to com.android.credentials.RESET
* Only the Settings app can reset credentials
  via com.android.credentials.RESET.
* com.android.credentials.INSTALL should still be
  callable by CertInstaller.

Manual testing steps:
* Install certificate via Settings
* Verify unable to reset certificates via test app
  provided in the bug (app-debug.apk)
* Verify able to reset certificates via Settings
* Verify com.android.credentials.INSTALL isn't changed

Bug: 200164168
Test: manual
Change-Id: I9dfde586616d004befbee529f2ae842d22795065
(cherry picked from commit 4c1272a921)
Merged-In: I9dfde586616d004befbee529f2ae842d22795065
2022-01-06 22:17:17 +00:00
Alex Johnston
88b7d05d76 Add non system overlay flag to InstallCaCertificateWarning am: fca5cb3748
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16405873

Change-Id: I6b616fa81ce4c5c53e553f8e692fdc059bb894fe
2021-12-09 12:03:22 +00:00