CVE-2026-59015 AI-generated analysis
platform/frameworks/base, CompanionDeviceManager (services/companion SystemDataTransferProcessor)
Removes the caller-supplied packageName and userId parameters from the ICompanionDeviceManager system data transfer methods and makes SystemDataTransferProcessor derive both from the AssociationInfo returned by getAssociationWithCallerChecks, which now runs before any state is written.
Root cause
ICompanionDeviceManager.buildPermissionTransferUserConsentIntent, isPermissionTransferUserConsented and startSystemDataTransfer took String packageName and int userId from the client (CompanionDeviceManager passed mContext.getOpPackageName() and mContext.getUserId(), but these were client-supplied Binder arguments). In SystemDataTransferProcessor.buildPermissionTransferUserConsentIntent the caller-supplied packageName was fed to PackageUtils.isPermSyncAutoEnabled, and if it returned true the method wrote a PermissionSyncRequest with setUserConsented(true) into mSystemDataTransferRequestStore under the caller-supplied userId and returned, all before mAssociationStore.getAssociationWithCallerChecks(associationId) was invoked. The non-auto path also used the caller-supplied userId for request.setUserId. startSystemDataTransfer likewise accepted packageName/userId from the caller and only called getAssociationWithCallerChecks for its side effect, ignoring the returned association. Nothing bound the supplied packageName/userId to the association identified by associationId.
How the fix works
- core/java/android/companion/ICompanionDeviceManager.aidl: buildPermissionTransferUserConsentIntent, isPermissionTransferUserConsented and startSystemDataTransfer lose their String packageName/callingPackage and int userId parameters; only associationId (plus the callback for startSystemDataTransfer) remains.
- core/java/android/companion/CompanionDeviceManager.java: the four call sites (buildPermissionTransferUserConsentIntent, isPermissionTransferUserConsented, both startSystemDataTransfer overloads) stop passing mContext.getOpPackageName() and mContext.getUserId().
- services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java: the Binder stub implementations are updated to the new signatures and forward only associationId (and callback) to mSystemDataTransferProcessor.
- services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferProcessor.java:buildPermissionTransferUserConsentIntent: mAssociationStore.getAssociationWithCallerChecks(associationId) is moved to the first statement, and userId/packageName are taken from association.getUserId() and association.getPackageName(). The isPermSyncAutoEnabled check, the writeRequest(userId, ...) in the auto-enable branch, and request.setUserId(userId) now use association-derived values and execute only after the caller check.
- services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferProcessor.java:startSystemDataTransfer: getAssociationWithCallerChecks(associationId) is moved to the top, its result is kept, and packageName/userId are derived from the association instead of the parameters.
Completeness
- Covers all three AIDL entry points that carried caller-supplied packageName/userId for permission sync: buildPermissionTransferUserConsentIntent, isPermissionTransferUserConsented, startSystemDataTransfer. isPermissionTransferUserConsented already ignored those parameters in the service and already called getAssociationWithCallerChecks first; the change there is signature-only.
- In buildPermissionTransferUserConsentIntent the caller check now precedes the auto-enable early return, closing the path where a consented PermissionSyncRequest was written before any caller check.
- Other methods in the shown context still take packageName/userId from the caller (attachSystemDataTransport, detachSystemDataTransport, removeBond, buildAssociationCancellationIntent, isCompanionApplicationBound, canPairWithoutPrompt). attachSystemDataTransport/detachSystemDataTransport are gated by DELIVER_COMPANION_MESSAGES and ignore the parameters; removeBond calls enforceCallerCanManageAssociationsForPackage. These are not changed by this fix.
- The rest of startSystemDataTransfer beyond the shown hunk is not in the material, so further uses of packageName/userId there are not verifiable; the diff only shows the log line using them.
Behavior changes
- ICompanionDeviceManager AIDL signatures change for three methods; any code calling the old signatures (including tests or OEM customizations) must be updated.
- In buildPermissionTransferUserConsentIntent, getAssociationWithCallerChecks now runs before the auto-enable branch, so any rejection it raises (the client propagates DeviceNotAssociatedException) occurs before state is written, where previously the branch could return null and write a consented request without that check.
- PermissionSyncRequest userId and the mSystemDataTransferRequestStore write key are now always the association's userId, not a caller-chosen value.
- Log lines now print the association's packageName/userId instead of caller-supplied values.
Per major
- Android 14: Not listed by the bulletin (not affected per the bulletin). At android-security-14.0.0_r31, 6/8 lines of the patched region are present, the same count as in the fixed tags, so this does not indicate whether the fix or the vulnerable code is present.
- Android 15: Same fix: platform/frameworks/base ebdc6383c30e in android-security-15.0.0_r19, cherry-pick of e4984771184f (Change-Id I4083fb0866ae375c60e845ba72025538e727d8e4). Four files.
- Android 16: Same fix: platform/frameworks/base 6eaaa132ae6f in android-security-16.0.0_r10. Same hunks as 15, only line offsets differ in CompanionDeviceManager.java, ICompanionDeviceManager.aidl and CompanionDeviceManagerService.java; SystemDataTransferProcessor.java hunk is identical (same blob indexes).
- Android 17: Same fix: platform/frameworks/base dc12ed90af74 in android-security-17.0.0_r3. Same hunks, line offsets differ; SystemDataTransferProcessor.java hunk is identical (same blob indexes).
Unknowns
- The remainder of SystemDataTransferProcessor.startSystemDataTransfer and the implementation of mAssociationStore.getAssociationWithCallerChecks are not shown, so the exact checks enforced and any further use of the old parameters are not verifiable.
- The concrete information disclosure path behind the bulletin's ID rating is not described in the material.
- Contents of the isPermSyncAutoEnabled allowlist are not shown.
- Whether Android 14 contains the vulnerable code is not shown; the line-presence count is inconclusive.