CVE-2026-49931 AI-generated analysis
platform/packages/services/Telephony, Phone app call forwarding settings (CdmaCallForwardOptions, GsmUmtsCallForwardOptions)
Adds a caller URI-permission check (ComponentCaller.checkContentUriPermission with FLAG_GRANT_READ_URI_PERMISSION) plus null checks on the contact URI returned by the contact picker in CdmaCallForwardOptions.onActivityResult and GsmUmtsCallForwardOptions.onActivityResult, placed before the Phone app queries the URI.
Root cause
In CdmaCallForwardOptions.onActivityResult and GsmUmtsCallForwardOptions.onActivityResult, the Phone app took the URI from the activity that answered the contact picker intent and queried it. The existing code only checked that the URI "belongs to the user" (per the in-code comment). It never checked that the app returning the result actually held read permission on that URI. Per the commit message, a third-party app acting as the contact picker could return an Enterprise contact URI (pointing at a work profile contact) that it could not read itself, and the Phone app would query and display that contact. Per the commit message, the code also lacked null checks on the returned contact URI, which could lead to NullPointerExceptions in ContentResolver.query.
How the fix works
- src/com/android/phone/ContactPermissionUtils.java (new): checkContactUriPermission(ComponentCaller caller, Uri uri) throws SecurityException when caller is null and returns with a warning when uri is null. Otherwise it calls caller.checkContentUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION). If the result is PackageManager.PERMISSION_DENIED, it throws a SecurityException naming the caller uid/package and the URI.
- src/com/android/phone/CdmaCallForwardOptions.java:onActivityResult: after the RESULT_OK check, returns early if data == null or data.getData() == null. It then calls ContactPermissionUtils.checkContactUriPermission(getCurrentCaller(), contactUri) before the existing Cursor query block.
- src/com/android/phone/GsmUmtsCallForwardOptions.java:onActivityResult: the same insertion (null checks plus checkContactUriPermission(getCurrentCaller(), contactUri)) before the Cursor query block.
- tests/robotests/src/com/android/phone/ContactPermissionUtilsTest.java (new): covers null caller (throws), null URI (returns), permission granted (returns) and permission denied (throws with the expected message).
Completeness
- Both contact-picker result handlers in the Phone app's call forwarding settings (CDMA and GSM/UMTS) are guarded. The check runs before any ContentResolver.query on the returned URI.
- The check relies entirely on the system's ComponentCaller.checkContentUriPermission. The fix does not also restrict the URI to the Contacts authority or to a specific path, so it depends on the system permission model rather than on validating the URI's shape.
- The existing 'belongs to the user' check in the query block stays in place. The new check is added on top of it.
- The utility is only wired into these two activities. The material does not show whether other Telephony UI paths accept URIs returned by a picker, so coverage of other result handlers cannot be judged.
- On a denial, the SecurityException is thrown from onActivityResult and the diff does not catch it.
Behavior changes
- onActivityResult now logs a warning (Log.w) and returns early when the result Intent or its data URI is null, instead of reaching ContentResolver.query.
- If the app returning the result lacks read permission on the URI, or getCurrentCaller() returns null, onActivityResult throws a SecurityException and the contact is not queried or displayed.
- A legitimate picker that grants read permission on the returned URI is unaffected.
Per major
- Android 14: Adapted fix (787ad217f9a9, android-security-14.0.0_r29). Both activities get the same null checks, but ContactPermissionUtils.checkContactUriPermission takes (Intent data, Uri uri) and only checks that data.getFlags() contains Intent.FLAG_GRANT_READ_URI_PERMISSION, throwing SecurityException otherwise. It does not use ComponentCaller or getCurrentCaller. In this branch GsmUmtsCallForwardOptions.onActivityResult does not query the contact (it logs 'functionality is no longer supported'), so the check there is defensive. The test is in tests/src instead of tests/robotests. 8/8 lines of the patched region present at android-security-14.0.0_r31.
- Android 15: This fix (40d1716b1076, android-security-15.0.0_r17): ComponentCaller-based check via getCurrentCaller(). 8/8 lines of the patched region present at android-security-15.0.0_r19.
- Android 16: Same fix (73bc9bf6eb4c, android-security-16.0.0_r8), with the same diff and file hashes as the 15 commit. 8/8 lines of the patched region present at android-security-16.0.0_r10.
- Android 17: Same fix (7e3d27fd759f, android-security-17.0.0_r1) with the same added code. The CdmaCallForwardOptions base file differs and its hunk offset is line 219 instead of 217. 8/8 lines of the patched region present at android-security-17.0.0_r3.
Unknowns
- The pre-fix query code and the existing 'belongs to the user' check are not shown beyond the comment line, so the material does not show how an Enterprise URI passed that check.
- The material does not show whether other Telephony activities accept contact URIs returned by a picker without this check.
- The material does not show how the uncaught SecurityException in onActivityResult appears to the user (activity or process crash, or handled elsewhere).