
20 security issues found in Xiaomi devices
20 Security Issues Found in Xiaomi Devices | Oversecured Blog
Oversecured's write-up of 20 vulnerabilities in Xiaomi apps and system components, reported to Xiaomi between 25 and 30 April 2023. Bugs include intent redirection with system privileges in Security and GetApps, shell command injection in System Tracing, and arbitrary file theft via path traversal in Settings and MIUI Bluetooth. Each has a PoC. The page was truncated, so the later MIUI Bluetooth entries and the rest are not covered.
What it is
Oversecured's April 2023 report of 20 vulnerabilities in Xiaomi apps and system components, found by its scanner and reported to Xiaomi between 25 and 30 April 2023. The page says they were "resolved", but it gives no fixed versions, CVE ids or dates. Each entry has a short PoC. The sections below cover entries the catalog summary does not name.
How it works
The bugs fall into a few repeating classes.
Intent, broadcast and service redirection from privileged apps
- Security Core Component (
com.miui.securitycore):com.miui.xspace.receiver.MediaScannerReceiverclears the intent's component but keeps its selector. Xiaomi's receiver gets the broadcast first, then it is forwarded to any receiver the attacker names, including non-exported ones. The action must beandroid.intent.action.MEDIA_SCANNER_SCAN_FILEormiui.intent.action.MEDIA_SCANNER_SCAN_FOLDER. The app is a system app, so it can reach receivers in any installed app. - Settings:
WifiDppEnrolleeActivitybinds whatever service is named by the extrasfloating_service_pkgandfloating_service_path. This comes fromMultiAppFloatingActivitySwitcher.install()in themiuixSDK. Oversecured believes the SDK is present in many Xiaomi apps and makes them vulnerable too. - GetApps (
com.xiaomi.mipicks): the exportedMainUserAgreementActivityandAppChooserActivityforward an attacker-suppliedtargetIntent. This reaches non-exported activities, includingDebugPreferenceFragmentActivity, andUnlockActivitycan act as a proxy to other apps.
Unauthenticated destructive or injectable actions
- Security Core Component: a dynamically registered receiver in
SecondSpaceService.javahandles the actioncom.miui.securitycore.ACTION_TO_REMOVE_USER. Any app can send it, and it stops and deletes the current user, then locks the screen. - GetApps: the LiveEventBus library registers an insecure receiver for
intent.action.ACTION_LEB_IPC. Attacker JSON is deserialized by Gson into arbitrary classes, including ones holding native pointers, which gives memory corruption on destruction. Oversecured says it told the library's developer over a year earlier and got no fix. The PoC usescom.android.internal.util.VirtualRefBasePtr. - Xiaomi Cloud: a dynamic receiver in
ShareLocationHybridActivityconcatenates thepush_dataextra into JavaScript run in a WebView (XSS). The app must be running so the receiver is registered. - Print Spooler: the exported
ConvertPdfAlertActivitybuilds an output path from the provider-controlled_display_name. Using../../gives an arbitrary file write or overwrite.
File access
- MIUI Bluetooth (
com.xiaomi.bluetooth): the exportedHeadsetProviderdoes not validate the resultingFile, so path traversal reads arbitrary files. It runs underandroid.uid.bluetooth. The PoC reads/sdcard/test.txt. - Settings
MiuiFastConnectResourceProvider: the checksendsWith(".zip")and!contains("../")are bypassed with%2Fencoding and a#.zipfragment. The PoC readssettings_secure.xml.
Data leaks through implicit intents
- Settings broadcasts leak Bluetooth devices, connected Wi-Fi networks and emergency contacts. Settings activity intents also leak Xiaomi account details and phone numbers.
- MIUI Bluetooth broadcasts leak connected device data without requiring
android.permission.BLUETOOTH. - Phone Services intents leak the ICCID and IMSI of virtual SIMs.
- GetApps intents (
com.xiaomi.global.payment.MI_PAYMETHOD,MI_ORDERSLIST) leak Xiaomi session tokens. - Mi Video broadcasts leak the user's name and email.
- Gallery: an implicit avatar-picker intent can be intercepted. It also grants read URI permission to any handler of
com.android.camera.action.CROP, so an attacker app can read arbitrary content providers. The PoC dumps contacts. Oversecured says the pattern appears in several Xiaomi apps.
Crypto
- ShareMe (
com.xiaomi.midrop) encrypts private-file metadata in/sdcard/ShareMe/safebox/with DES and a hardcoded key,miuiMidrop. The page includes the decrypt routine.
Preconditions / Affected
Every PoC is an attacker app installed on the same device. Several entries are worse because the target is a system app (android.uid.system for Security, system-privileged Settings). The page names no device models or MIUI versions.
What to do
The page states no patch versions or update instructions. A defender can check the defect classes it shows:
- Audit exported components that forward a caller-supplied
Intent, selector or component name. - Audit providers that build file paths from URIs or
_display_name. - Audit sensitive data sent in implicit intents.
- Audit hardcoded keys.
Caveats
The fetched text was cut at about 60,000 of 60,983 characters, in the Mi Video entry. Its PoC and anything after it were not seen, so the 20-item count cannot be checked against the text read. The page labels some entries with package names that look inconsistent: Xiaomi Cloud and the GetApps token entry. Whether every issue is fixed, and in which builds, is not stated.
Organisations named here
- android.uid.system
- CWE-78
- implicit intent interception
- LiveEventBus
- memory corruption
- MIUI
- Xiaomi
Technologies named here
- Oversecured
- Android
- GetApps (com.xiaomi.mipicks)
- GetApps (com.miui.videoplayer) as listed by the page
- Gson
- LiveEventBus library (com.jeremyliao.liveeventbus), unpatched by its developer
- miuix.appcompat SDK (MultiAppFloatingActivitySwitcher), present in many Xiaomi apps
- Security Core Component (com.miui.securitycore)
- System Tracing (com.android.traceur), AOSP app modified by Xiaomi
Techniques named here
- Intent Redirection
- Path traversal
- Command injection
- Binding arbitrary services with system privileges
- Implicit intent interception
- Shell command injection
- Unprotected dynamically registered broadcast receiver
Also named here
- CWE-22
Related in Mobile Security
thomasbuilds/Spectre
