Every CVE Search/ Get API key

CVE-2024-41945

The fuels-ts typescript SDK has no awareness of to-be-spent transactions

3.1 LowFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
None

Exploit likelihood

0.31%Up 0.3 points since Jul 31, 2024
90%50%10%1%

What each source reports

CVE List Score used 3.1

The fuels-ts typescript SDK has no awareness of to-be-spent transactions

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.

Record
CVE-2024-41945
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
EUVDEUVD-2024-2237 3.1

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.

Record
EUVD-2024-2237
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-3jcg-vx7f-j6qf 2.3

The fuels-ts typescript SDK has no awareness of to-be-spent transactions

Brief/Intro

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 Typescript SDK provides the fund function which retrieves UTXOs, which belong to the owner and can be used to fund the request in question, from fuel's graphql api. These then get added to the request making it possible to send it to the network as it now has inputs which can be spent by its outputs. Now this works when a user only wants to fund one transaction per block as in the next block, the spent UTXO will not exist anymore. However if a user wants to fund multiple transactions within one block, the following can happen:

It is important to note, that the graphql API will return a random UTXO which has enough value to fund the transaction in question.

  • user has 2 spendable UTXOs in their wallet which can cover all expenses
  • user funds transaction tA with an input gotten from the API iA
  • user submits tA to fuel
  • iA is still in possession of the user as no new block has been produced
  • user funds a transaction tB and gets the same input iA from the API
  • user tries to submit transaction tB to fuel but now one of the following can happen:
    • if the recipient and all other parameters are the same as in tA, submission will fail as tB will have the same txHash as tA
    • if the parameters are different, there will be a collision in the txpool and tA will be removed from the txpool

Vulnerability Details

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:

 async fund<T extends TransactionRequest>(request: T, params: EstimatedTxParams): Promise<T> {

    // [...]

    let missingQuantities: CoinQuantity[] = [];
    Object.entries(quantitiesDict).forEach(([assetId, { owned, required }]) => {
      if (owned.lt(required)) {
        missingQuantities.push({
          assetId,
          amount: required.sub(owned),
        });
      }
    });

    let needsToBeFunded = missingQuantities.length > 0;
    let fundingAttempts = 0;
    while (needsToBeFunded && fundingAttempts < MAX_FUNDING_ATTEMPTS) {
      const resources = await this.getResourcesToSpend(
        missingQuantities,
        cacheRequestInputsResourcesFromOwner(request.inputs, this.address)
      ); // @audit-issue here we do not exclude ids we already got and used for another transaction in the current block

      request.addResources(resources);

      // [...]
    }

    // [...]

    return request;
  }

Impact Details

This issue will lead to unexpected SDK behaviour. Looking at the scenario in Brief/Intro, it could have the following impacts for users:

  1. A transaction does not get included in the txpool / in a block
  2. A previous transaction silently gets removed from the txpool and replaced with a new one

Recommendation

I would recommend adding a buffer to the Account class, in which retrieved resources are saved. These can then be provided to getResourcesToSpend to be excluded from future queries but need to be removed from the buffer if their respective transaction fails to be included, in order to be able to use those resources again in such cases.

Proof of Concept

The following PoC transfers 100 coins from wallet2 to wallet after which wallet2 has two UTXOs one with value 100 and one with a very high value (this is printed to the console). Afterwards, wallet will attempt transfering 80 coins back to wallet2 twice in one block, each in a separate transaction. This should work perfectly fine as wallet has two UTXOs where each can cover the cost of each respective transaction. Now when running this one of the following will happen:

  1. both transfers from wallet to wallet2 get a different UTXO. This is…
Record
GHSA-3jcg-vx7f-j6qf
CVSS 4.0
2.3 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
NVD 3.1

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.

Record
CVE-2024-41945
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
OSV 3.1

The fuels-ts typescript SDK has no awareness of to-be-spent transactions

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.

Record
CVE-2024-41945
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02
OSVGHSA-3jcg-vx7f-j6qf 2.3

The fuels-ts typescript SDK has no awareness of to-be-spent transactions

Brief/Intro

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 Typescript SDK provides the fund function which retrieves UTXOs, which belong to the owner and can be used to fund the request in question, from fuel's graphql api. These then get added to the request making it possible to send it to the network as it now has inputs which can be spent by its outputs. Now this works when a user only wants to fund one transaction per block as in the next block, the spent UTXO will not exist anymore. However if a user wants to fund multiple transactions within one block, the following can happen:

It is important to note, that the graphql API will return a random UTXO which has enough value to fund the transaction in question.

  • user has 2 spendable UTXOs in their wallet which can cover all expenses
  • user funds transaction tA with an input gotten from the API iA
  • user submits tA to fuel
  • iA is still in possession of the user as no new block has been produced
  • user funds a transaction tB and gets the same input iA from the API
  • user tries to submit transaction tB to fuel but now one of the following can happen:
    • if the recipient and all other parameters are the same as in tA, submission will fail as tB will have the same txHash as tA
    • if the parameters are different, there will be a collision in the txpool and tA will be removed from the txpool

Vulnerability Details

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:

 async fund<T extends TransactionRequest>(request: T, params: EstimatedTxParams): Promise<T> {

    // [...]

    let missingQuantities: CoinQuantity[] = [];
    Object.entries(quantitiesDict).forEach(([assetId, { owned, required }]) => {
      if (owned.lt(required)) {
        missingQuantities.push({
          assetId,
          amount: required.sub(owned),
        });
      }
    });

    let needsToBeFunded = missingQuantities.length > 0;
    let fundingAttempts = 0;
    while (needsToBeFunded && fundingAttempts < MAX_FUNDING_ATTEMPTS) {
      const resources = await this.getResourcesToSpend(
        missingQuantities,
        cacheRequestInputsResourcesFromOwner(request.inputs, this.address)
      ); // @audit-issue here we do not exclude ids we already got and used for another transaction in the current block

      request.addResources(resources);

      // [...]
    }

    // [...]

    return request;
  }

Impact Details

This issue will lead to unexpected SDK behaviour. Looking at the scenario in Brief/Intro, it could have the following impacts for users:

  1. A transaction does not get included in the txpool / in a block
  2. A previous transaction silently gets removed from the txpool and replaced with a new one

Recommendation

I would recommend adding a buffer to the Account class, in which retrieved resources are saved. These can then be provided to getResourcesToSpend to be excluded from future queries but need to be removed from the buffer if their respective transaction fails to be included, in order to be able to use those resources again in such cases.

Proof of Concept

The following PoC transfers 100 coins from wallet2 to wallet after which wallet2 has two UTXOs one with value 100 and one with a very high value (this is printed to the console). Afterwards, wallet will attempt transfering 80 coins back to wallet2 twice in one block, each in a separate transaction. This should work perfectly fine as wallet has two UTXOs where each can cover the cost of each respective transaction. Now when running this one of the following will happen:

  1. both transfers from wallet to wallet2 get a different UTXO. This is…
Record
GHSA-3jcg-vx7f-j6qf
CVSS 4.0
2.3 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
3.1 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-20
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
@fuel-ts/account
npm
before 0.93.0
0.93.0

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-41945 is a low vulnerability (CVSS 3.1) in Fuellabs Fuels-ts, published July 30, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.31%, the 23rd percentile. Fixed in @fuel-ts/account 0.93.0.

References

This page doesn't list everything

Left out here: the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open