Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
LOW severity

GHSA-3jcg-vx7f-j6qf — @fuel-ts/account

LOWFix: FuelLabs/fuels-ts@16ee1bf

GHSA-3jcg-vx7f-j6qf is a low-severity (CVSS 3.1) Improper Input Validation vulnerability in @fuel-ts/account. A fix is available for @fuel-ts/account — see the affected versions and patch details below.

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

Also known asCVE-2024-41945
Published
Jul 30, 2024
Updated
Jul 30, 2024
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 25, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for GHSA-3jcg-vx7f-j6qf.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs21th percentile — riskier than 21% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-3jcg-vx7f-j6qf plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 379,145 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

7other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@fuel-ts/accountnpm
7Kdownloads / week

Description

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 the case if execution is successful and wallet2 has 80 coins more than wallet in the end.
  2. both transfers get the same UTXO. In this case the script will fail and throw an error as then both transactions will have the same hash

In order to execute this PoC, please deploy a local node with a blocktime of 5secs as I wrote my PoC for that blocktime. Note that with a small change it will also work with other blocktimes. Then add the PoC to a file poc_resources.ts and compile it with tsc poc_resources.ts. Finally execute it with node poc_resources.js.

Since the choice which UTXO is taken as input is random, it might take a few tries to trigger the bug!

import { JsonAbi, Script, Provider, WalletUnlocked, Account, Predicate, Wallet, CoinQuantityLike, coinQuantityfy, EstimatedTxParams, BN, Coin, AbstractAddress, Address, Contract, ScriptTransactionRequest } from 'fuels';

const abi: JsonAbi = {
  'encoding': '1',
  'types': [
    {
      'typeId': 0,
      'type': '()',
      'components': [],
      'typeParameters': null
    }
  ],
  'functions': [
    {
      'inputs': [],
      'name': 'main',
      'output': {
        'name': '',
        'type': 0,
        'typeArguments': null
      },
      'attributes': null
    }
  ],
  'loggedTypes': [],
  'messagesTypes': [],
  'configurables': []
};

const FUEL_NETWORK_URL = 'http://127.0.0.1:4000/v1/graphql';

async function executeTransaction() {

  const provider = await Provider.create(FUEL_NETWORK_URL);
  
  const wallet: WalletUnlocked = Wallet.fromPrivateKey('0x37fa81c84ccd547c30c176b118d5cb892bdb113e8e80141f266519422ef9eefd', provider);
  const wallet2: WalletUnlocked = Wallet.fromPrivateKey('0xde97d8624a438121b86a1956544bd72ed68cd69f2c99555b08b1e8c51ffd511c', provider);
  const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));


  console.log("Balance wallet before: ", await wallet.getBalance());
  console.log("Balance wallet2 before: ", await wallet2.getBalance());

  wallet2.transfer(wallet.address, 100);

  await sleep(5500);


  await wallet.transfer(wallet2.address, 80);
  console.log('wallet -> wallet2');

  await wallet.transfer(wallet2.address, 80);
  console.log('wallet -> wallet2');

  console.log("Balance wallet after: ", await wallet.getBalance());
  console.log("Balance wallet2 after: ", await wallet2.getBalance());
};

executeTransaction().catch(console.error);

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npm@fuel-ts/accountall versions0.93.0npm install @fuel-ts/account@0.93.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @fuel-ts/account, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update @fuel-ts/account to 0.93.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3jcg-vx7f-j6qf is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-3jcg-vx7f-j6qf can be triaged on real exposure rather than presence alone.

Tailored to GHSA-3jcg-vx7f-j6qf. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

# 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 UTX
O3 Security · Impact-Aware SCA

Is GHSA-3jcg-vx7f-j6qf in your dependencies?

O3 Security finds GHSA-3jcg-vx7f-j6qf across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-3jcg-vx7f-j6qf: @fuel (Low 3.1) | O3 Security