| commit | b5c655f0f676381b1cf8d1e23eb75cacd964afd8 | [log] [tgz] |
|---|---|---|
| author | Patrick Rohr <[email protected]> | Fri Dec 20 09:52:33 2024 -0800 |
| committer | Android Build Coastguard Worker <[email protected]> | Wed Apr 09 15:18:39 2025 -0700 |
| tree | 58d22e49f99517e47f2759163b262bad6a4340ef | |
| parent | 2193ab0467322ad22725e13ef375269f0921e3aa [diff] |
Add missing permission check to offerNetwork The missing permission check means that an unauthorized app could have registered a network offer to intercept all NetworkRequests (by trivially guessing an existing provider ID) which would have leaked information about other apps on the system. This adds a NETWORK_FACTORY or MAINLINE_NETWORK_STACK permission check to offerNetwork per the API annotations in ConnectivityManager. Test networks can be offered when holding the MANAGE_TEST_NETWORKS permission which is consistent with similar APIs in this class. There can be no legitimate use of this API a) offerNetwork is @hide and only exposed via NetworkProvider, and b) it requires getting a provider ID by calling registerNetworkProvider which correctly enforces permissions. unofferNetwork does not currently require any permissions. Again, this is consistent with the API annotations in ConnectivityManager. Test: TH (cherry picked from https://android-review.googlesource.com/q/commit:ff65257bd07c791a5bfef2f54bf96ae224c03273) Bug: 388828859 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1917a04ae0ebf221232f9f3bf80fe329a01c6ed2) Merged-In: If71ce012f927a34c647d36b5eaf3723de2c01879 Change-Id: If71ce012f927a34c647d36b5eaf3723de2c01879