Re:Funds of every Trust Wallet browser extension could have ...
by lxgr on Monday May 01, 2023 @05:00PM
(#35779074)
Ironically, they probably even did that (depending on their implementation of std::random_device).
The problem is what they did with that random seed once they had retrieved it (i.e. seed a non-cryptographic Mersenne Twister with only 32 bits of it).
Anyhow, they could still have used webcrypto through WASM or even through JavaScript (as they can send the data back). This is really not a problem with WASM but moreso with the stupid implementation of this wallet.
edit: According to this PR they were indeed using std::mt19937 [1]. In fact I would go further ahead and say this is a general issue of C++ itself which just does not provide good PRNGs in the stdlib at all, with multiple way of achieving different (but similarly broken) PRNG results.
[0]: https://en.m.wikipedia.org/wiki/CryptMT
[1]: https://github.com/trustwallet/wallet-core/pull/2240