Bitpie wallet(比特派钱包) is a comprehensive blockchain asset service product, with main features including: sending and receiving, buying and selling, accelerated transactions, exchanges, etc. It is currently the most popular mobile digital currency wallet with support for multiple currencies. Security is a key feature that Bitpie is emphasizing.
After a simple analysis of the Bitpie app, we found that Bitpie stores all of the user's initial digital currency keys in plain text.
When Bitpie is launched, it randomly generates 128 bits of initial entropy, and then, in accordance with BIP32 requirements, expands this 128 bits of entropy into a 132-bit value to generate a 12-word mnemonic.
Bitpie Android Version:
The mnemonic serves as the initial key, according to the BIP32 standard. It should act as the user's mnemonic phrase, and the app should not store it. However, the Android version of Bitpie directly saves the user's initial key in plain text in the file /com.biepie/shared_prefs/com.bitpie_preferences.xml. Even when the user sets a password, this file remains unencrypted.
The string <string name="seedPhraseEntropy">0b506e43a5f4a53b8a370984dfb0ec89</string> represents the initial entropy. Based on this initial entropy, it is quite easy to restore the 12 mnemonic words. It actually is: area lock movie episode engage oven churn thrive luggage work depth because. And the corresponding secret key is
<string name="seed">b8409639eba3c15499e66aaa043ac0f512a49adce99be828d405147533c60a5b5c3a7351a27cf05c144f08d5ad761d7c8642deeb5235a867ebfb0d0b09608ec8</string>
Then you can calculate the BIP ROOT key by using PBKDF2:
xprv9s21ZrQH143K3y28DNpu5HE7NFQ61MZxXFfMnkM6cK6k9wRmaCpq3GLbZFpNwnC7cTf6dKVKCLAvqdA1PmEgBaZ826U4HySzG9ZkrmvAsux
Bitpie iOS Version:
For Bitpie iOS version, the seedkey file is save under the app directory:
<key>seedKey</key>
<string>889183F3C372B41CAE4025A101FA0022D774719FEF54F4E91D8C1EA3836710C41A1B434F1814A72C6A4AC2C16E567BA01FA91E33F7A73C01709B5DB453AF10E7</string>
I report this bug to Bitpie developer, however, Biepie respone that: it's a feauture, not a vulnerability