CVE-2026-55257 AI-generated analysis
platform/frameworks/base, SystemUI USB permission/confirm dialogs (packages/SystemUI/src/com/android/systemui/usb/UsbDialogHelper.java)
SystemUI's UsbDialogHelper now loads the requesting app's display name with ApplicationInfo.loadSafeLabel (limited to DEFAULT_MAX_LABEL_SIZE_PX, with SAFE_STRING_FLAG_TRIM and SAFE_STRING_FLAG_FIRST_LINE) instead of loadLabel. This keeps an unsanitized app label out of the USB permission/confirm dialogs.
Root cause
In UsbDialogHelper, mAppName (the name of the package requesting USB access) was obtained with aInfo.loadLabel(packageManager). That call returns the label without the size limit, trimming and first-line restriction that loadSafeLabel applies. The app-controlled label was therefore shown unsanitized in the SystemUI USB dialogs. The commit describes this only as a 'label vulnerability'.
How the fix works
- packages/SystemUI/src/com/android/systemui/usb/UsbDialogHelper.java (inside class UsbDialogHelper, in the try block after packageManager.getApplicationInfo(mPackageName, 0)): aInfo.loadLabel(packageManager) is replaced with aInfo.loadSafeLabel(packageManager, DEFAULT_MAX_LABEL_SIZE_PX, SAFE_STRING_FLAG_TRIM | SAFE_STRING_FLAG_FIRST_LINE). The label is now size-limited, trimmed and reduced to its first line.
- Three static imports are added: DEFAULT_MAX_LABEL_SIZE_PX (android.content.pm.PackageItemInfo), and SAFE_STRING_FLAG_TRIM and SAFE_STRING_FLAG_FIRST_LINE (android.text.TextUtils).
- Android 17 only: packages/SystemUI/tests/src/com/android/systemui/usb/UsbDialogActivityTest.kt is updated so the test's expected mAppName is computed with the same loadSafeLabel call and flags.
Completeness
- The diff changes the mAppName assignment in UsbDialogHelper. The commit lists tests for both the USB confirm and permission dialogs (UsbConfirmActivityTest, UsbPermissionActivityTest). The material does not show whether any other label-loading call sites exist.
- Only the application label is sanitized. Other strings shown in these dialogs, such as device or accessory names, are not touched by this change. The material does not show whether they are sanitized elsewhere.
- The diff contains no flag check, even though the commit message lists Flag: android.hardware.usb.flags.enable_persistent_usb_device_permissions. The sanitization therefore applies regardless of that flag.
Behavior changes
- App names in the USB permission/confirm dialogs are now limited to DEFAULT_MAX_LABEL_SIZE_PX, trimmed, and reduced to their first line. Long or multi-line labels will display differently than before.
- No new error paths: NameNotFoundException handling is unchanged.
Per major
- Android 14: same fix: identical diff (blob 3f061d3113be -> 29a9a7fb0612) applied as e5d1fb2c34ce in android-security-14.0.0_r29. At android-security-14.0.0_r31, 7/8 lines of the patched region are present.
- Android 15: same fix: identical diff applied as 8c99389ef61e in android-security-15.0.0_r17. At android-security-15.0.0_r19, 7/8 lines of the patched region are present, and the code context shows the three added imports.
- Android 16: same fix: identical diff applied as e5560bd1d0c2 in android-security-16.0.0_r8. At android-security-16.0.0_r10, 7/8 lines of the patched region are present.
- Android 17: same source change on a different base of UsbDialogHelper.java (blob 074b12588d34 -> f1193ebbd1f7), plus an update to UsbDialogActivityTest.kt that computes the expected label with loadSafeLabel. Applied as 1f47cb234369 in android-security-17.0.0_r1. At android-security-17.0.0_r3, 7/8 lines of the patched region are present.
Unknowns
- The exact spoofing effect behind the report (which dialog text was misrepresented) is not shown in the material.
- The material does not show which one line of the 8-line patched region is unmatched in each latest security tag.
- How the USB dialogs are triggered (for example, whether a connected device or accessory is required) is not shown.
- Whether the commit-listed flag android.hardware.usb.flags.enable_persistent_usb_device_permissions relates to this change beyond the commit metadata is not shown.
- Whether other label-loading call sites exist in the SystemUI USB code is not shown.