# CVE-2024-41945: The fuels-ts typescript SDK has no awareness of to-be-spent transactions

> The Fuel TypeScript SDK fails to track spent UTXOs, causing transactions to fail or be silently pruned from the mempool.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-3jcg-vx7f-j6qf

## What is CVE-2024-41945?

CVE-2024-41945 is a low-severity vulnerability in FuelLabs fuels-ts, published on 30 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

fuels-ts is a library for interacting with Fuel v2.  The typescript SDK has no awareness of to-be-spent transactions causing some transactions to fail or silently get pruned as they are funded with already used UTXOs. The problem occurs, because the `fund` function in `fuels-ts/packages/account/src/account.ts` gets the needed ressources statelessly with the function `getResourcesToSpend` without taking into consideration already used UTXOs. This issue will lead to unexpected SDK behaviour, such as a transaction not getting included in the `txpool` / in a block or a previous transaction silently getting removed from the `txpool` and replaced with a new one.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2024-41945?

2 open source packages ship an affected version, including @fuel-ts/account.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@fuel-ts/account` | npm | All versions | 0.93.0 |
| `@fuel-ts/account` | npm | All versions | 0.93.0 |

## How do I fix CVE-2024-41945?

Upgrade @fuel-ts/account to 0.93.0 or later.

## Is CVE-2024-41945 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-41945 and fix it if it is affected.

What it is: CVE-2024-41945 is a low-severity vulnerability in FuelLabs fuels-ts, published on 30 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-41945 exists.

Affected packages and fixed versions:
- @fuel-ts/account (npm): affected all versions; fixed in 0.93.0
- @fuel-ts/account (npm): affected all versions; fixed in 0.93.0

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-2024-41945/ (Markdown: https://insights.sbomify.com/CVE-2024-41945/index.md)
```

## Sources

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

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