Researching Xiaomi’s TEE to get to Chinese money
The Xiaomi TEE trusted apps lacked version control, allowing downgrade to old vulnerable versions, and the soter trusted app had a heap overflow and missing parameter type checks. An unprivileged Android app could exploit these to execute code or steal private keys, enabling forging of payment packages.
Published on research.checkpoint.com
Have you ever wondered if it is safe to make payments from a mobile device? Can a malicious app steal money from your digital wallet?
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The trusted app file format omitted a version control field, enabling downgrade attacks, and the soter trusted app failed to check buffer sizes and parameter types.
Impact
An unprivileged Android app could execute code in the soter trusted app to forge payment packets or steal private keys, completely compromising the Tencent soter platform.
What the attacker needed
Unprivileged Android app installed; device with vulnerable Xiaomi TEE; no user interaction required
The fix
Xiaomi patched the heap overflow (CVE-2020-14125) and the arbitrary read vulnerability; the downgrade issue, confirmed as a third-party vendor issue, is being fixed.
How it was found
- Extract an old version of the soter trusted app from a device running an older MIUI version.
- Overwrite the current soter trusted app on the target device with the old version.
- Use an unprivileged Android app to call the SoterService, which proxies commands to the soter trusted app.
- Send a command with a malformed parameter to trigger the arbitrary read vulnerability and leak the ATTK private key from memory.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A trusted execution environment (TEE) is a secure area inside a phone's chip that handles sensitive tasks like payments. The report found that Xiaomi's payment-related trusted apps had bugs: one allowed replacing a new app with an old, vulnerable version, and another had memory errors. A malicious app could abuse these to steal keys or run code, potentially forging payments.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.