# CVE-2023-31290: Weak cryptography in n/a

> Insufficient entropy in mnemonic generation allows attackers to predict wallet addresses and steal funds from Trust Wallet users.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 27 Apr 2023
- **Updated:** 30 Jan 2025
- **Also known as:** GHSA-pm4f-pggw-8jwc

## What is CVE-2023-31290?

CVE-2023-31290 is a medium-severity vulnerability in n/a, published on 27 Apr 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Trust Wallet Core before 3.1.1, as used in the Trust Wallet browser extension before 0.0.183, allows theft of funds because the entropy is 32 bits, as exploited in the wild in December 2022 and March 2023. This occurs because the mt19937 Mersenne Twister takes a single 32-bit value as an input seed, resulting in only four billion possible mnemonics. The affected versions of the browser extension are 0.0.172 through 0.0.182. To steal funds efficiently, an attacker can identify all Ethereum addresses created since the 0.0.172 release, and check whether they are Ethereum addresses that could have been created by this extension. To respond to the risk, affected users need to upgrade the product version and also move funds to a new wallet address.

Weakness: CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG))

## Which versions are affected by CVE-2023-31290?

It affects 2 products.


Products: Trustwallet Trust Wallet Browser Extension, Trustwallet Trust Wallet Core.

## How do I fix CVE-2023-31290?

No fix has been published for CVE-2023-31290 yet. Limit exposure of the affected software until one is available.

## Is CVE-2023-31290 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-31290 exists.

Public exploit code:

- (CVE-2023-31290) Trust Wallet Core before 3.1.1, as used in the Trust Wallet browser extension before 0.0.183, allows theft of funds because the entropy is 32 bits, as exploited in the wild in December 2022 and March 2023. (github_poc): https://github.com/ohexa/py_trustwallet_wasm

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-31290 and fix it if it is affected.

What it is: CVE-2023-31290 is a medium-severity vulnerability in n/a, published on 27 Apr 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-31290 exists.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-31290/ (Markdown: https://insights.sbomify.com/CVE-2023-31290/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-31290
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-31290
- OSV: https://osv.dev/vulnerability/CVE-2023-31290

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-31290/
Summaries are generated and may contain mistakes; the official description above is the record.
