Commit Graph
11 Commits
Author SHA1 Message Date
Jake Klinker a3f2d65241 [automerge] Use UriUtil when checking if a URI is a file. 2p: 27e27d944b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/16764000

Bug: 215212561
Change-Id: I59e1aa0f1799fb1eb993bd4e1089b665d0965099
2022-01-31 20:30:29 +00:00
Jake Klinker 27e27d944b Use UriUtil when checking if a URI is a file.
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE.

Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2
Bug: 215212561
2022-01-31 20:30:24 +00:00
Jake Klinker 391770a376 Fix isFileUri to recognize URIs with spaces. am: 6e0ca56095
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/16603852

Change-Id: Ic248ca97e7c775e7cef298bf03cdf13c53fb9351
2022-01-12 01:22:35 +00:00
Jake Klinker 6e0ca56095 Fix isFileUri to recognize URIs with spaces.
The underlying framework recognizes " file://..." as a valid URI and fetches the file, allowing for a possible exploit (see b/209965112). This trims the URI so that we can properly recognize it as a file from within our code.

Bug: 209965112
Change-Id: I8d9d9100e9a8c3bd64d19015d2177a14ec2306f3
Test: See repro steps on http://b/209965112, was no longer able to repro.
2022-01-11 00:41:38 +00:00
Jake Klinker c81f5c1bab Convert URI scheme to lower case before checking if it is a file. am: 58ee29c68e am: 92ce418906
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/15998887

Change-Id: I060a8878e5b0ee6d62cc57c849c2ab0a898657fe
2021-10-07 05:43:44 +00:00
Jake Klinker 58ad3740df Convert URI scheme to lower case before checking if it is a file. am: 58ee29c68e am: 8a9e12764a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/15998887

Change-Id: I8130588d8612124f3b827a93e44f242042edebf2
2021-10-07 05:42:16 +00:00
Jake Klinker 92ce418906 Convert URI scheme to lower case before checking if it is a file. am: 58ee29c68e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/15998887

Change-Id: I807f76373239f2aceedde821b654ce9de26ecd86
2021-10-07 05:33:56 +00:00
Jake Klinker 8a9e12764a Convert URI scheme to lower case before checking if it is a file. am: 58ee29c68e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/15998887

Change-Id: I54b996561d0248a4636e0991545cbfc0700e1ee4
2021-10-07 05:33:56 +00:00
Jake Klinker f40ef350b4 Convert URI scheme to lower case before checking if it is a file. am: 56bacbcb13
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Messaging/+/15998907

Change-Id: I708af5f19396bfcbbd6ee0ccea4f38c19c3c4dae
2021-10-07 04:53:55 +00:00
Jake Klinker 56bacbcb13 Convert URI scheme to lower case before checking if it is a file.
This fixes an edge case where a "File://" style URI could be passed in
but not pass this check, even though the underlying framework recognizes
this as a legitimate file.

Bug: 197328178
Test: See repro steps on http://b/197328178, was no longer able to
repro.

Change-Id: Id837744a79d1aca91b41d24207dc9b98f2b5b5e9
(cherry picked from commit 9607c95e71)
2021-10-06 22:38:45 +00:00
Jake Klinker 58ee29c68e Convert URI scheme to lower case before checking if it is a file.
This fixes an edge case where a "File://" style URI could be passed in
but not pass this check, even though the underlying framework recognizes
this as a legitimate file.

Bug: 197328178
Test: See repro steps on http://b/197328178, was no longer able to
repro.

Change-Id: Id837744a79d1aca91b41d24207dc9b98f2b5b5e9
(cherry picked from commit 9607c95e71)
2021-10-06 22:38:04 +00:00