GHSA-2pgj-5cv2-6xxw: Fuel vm FuelVM Is Vulnerable To Heap Vulnerability

HIGH
CWE-416
Published
Advisory Summary

GHSA-2pgj-5cv2-6xxw is a HIGH fuelvm is vulnerable to heap vulnerability (CWE-416: Use After Free) affecting Fuel vm libraries in the crates.io ecosystem. The issue involves fuelvm is vulnerable to heap memory allocation re-use bug. Remediation is available by upgrading affected packages to version 0.59.3, 0.60.1.

GHSA-2pgj-5cv2-6xxw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2pgj-5cv2-6xxw
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-416: Use After Free
Affected Product Fuel vm
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-2pgj-5cv2-6xxw

To remediate this vulnerability, upgrade all affected Fuel vm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fuel-vm fixed: 0.59.3
Upgrade fuel-vm to 0.59.3
fuel-vm fixed: 0.60.1
Upgrade fuel-vm to 0.60.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for fuel-vm

How to Check if You Are Affected

To determine whether your application is affected by GHSA-2pgj-5cv2-6xxw, inspect your project dependencies for Fuel vm:

inspect dependencies for fuel-vm

Analyze the terminal output to locate any version of Fuel vm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.59.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Fuel vm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A memory safety vulnerability was present in the Fuel Virtual Machine (FuelVM), where memory reads could bypass expected access controls. Specifically, when a smart contract performed a `mload` (or other opcodes which access memory) on memory that had been deallocated using `ret`, it was still able to access the old memory contents. This occurred because the memory region was not zeroed out or otherwise marked as invalid. As a result, smart contracts could potentially read sensitive data left over from other contracts if the same memory was reallocated, violating isolation guarantees between contracts and enabling unintended data leakage. All users running affected versions of FuelVM that relied on strict memory isolation between smart contracts were impacted. ### Patches The vulnerability was patched by modifying the FuelVM to ensure that memory deallocated with `ret` was zeroed out or made inaccessible. The fix was included in FuelVM version `v0.60.1` and back-ported to `v0.59.3`. This patch was released to the Fuel network on Friday, April 18th, 2025. ### Workarounds There were no reliable workarounds that fully mitigated the vulnerability. While developers could manually zero out sensitive memory regions before returning from a function, this approach was error-prone and could not be enforced at the VM level. Upgrading to a patched version remained the recommended course of action. ### References - Fix implemented in the FuelVM GitHub repository (https://github.com/FuelLabs/fuel-vm/pull/941)

GHSA-2pgj-5cv2-6xxw Affected Fuel vm Versions

2 component(s)
Fixed Versions:
0.59.30.60.1
Product / Package Ecosystem Affected Versions Fixed Version
fuel-vm
crates.io
< 0.59.3
0.59.3
fuel-vm
crates.io
≥ 0.60.0
< 0.60.1
0.60.1

References

Frequently Asked Questions

What is GHSA-2pgj-5cv2-6xxw?
GHSA-2pgj-5cv2-6xxw is a security vulnerability in Fuel vm involving FuelVM is vulnerable to heap memory allocation re-use bug under CWE-416: Use After Free.
Which Fuel vm versions are affected?
Affected versions include releases prior to 0.59.3, 0.60.1 across affected packages: fuel-vm.
What version fixes GHSA-2pgj-5cv2-6xxw?
Upgrading to 0.59.3, 0.60.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fuel-vm affected?
Yes, fuel-vm is affected in releases prior to 0.59.3, 0.60.1. Upgrade your dependency to 0.59.3, 0.60.1 or later.
What CWE is associated with GHSA-2pgj-5cv2-6xxw?
GHSA-2pgj-5cv2-6xxw is classified under CWE-416: Use After Free (The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.).
How can I check crates.io dependencies for GHSA-2pgj-5cv2-6xxw?
Run the dependency tree command: 'inspect dependencies for fuel-vm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2pgj-5cv2-6xxw",
  "modified" : "2025-10-08T12:43:30Z",
  "published" : "2025-10-08T12:43:30Z",
  "aliases" : [ ],
  "summary" : "FuelVM is vulnerable to heap memory allocation re-use bug",
  "details" : "### Impact\n\nA memory safety vulnerability was present in the Fuel Virtual Machine (FuelVM), where memory reads could bypass expected access controls. Specifically, when a smart contract performed a `mload` (or other opcodes which access memory) on memory that had been deallocated using `ret`, it was still able to access the old memory contents. This occurred because the memory region was not zeroed out or otherwise marked as invalid. As a result, smart contracts could potentially read sensitive data left over from other contracts if the same memory was reallocated, violating isolation guarantees between contracts and enabling unintended data leakage.\n\nAll users running affected versions of FuelVM that relied on strict memory isolation between smart contracts were impacted.\n\n### Patches\n\nThe vulnerability was patched by modifying the FuelVM to ensure that memory deallocated with `ret` was zeroed out or made inaccessible. The fix was included in FuelVM version `v0.60.1` and back-ported to `v0.59.3`. This patch was released to the Fuel network on Friday, April 18th, 2025.\n\n### Workarounds\n\nThere were no reliable workarounds that fully mitigated the vulnerability. While developers could manually zero out sensitive memory regions before returning from a function, this approach was error-prone and could not be enforced at the VM level. Upgrading to a patched version remained the recommended course of action.\n\n### References\n\n- Fix implemented in the FuelVM GitHub repository (https://github.com/FuelLabs/fuel-vm/pull/941)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "fuel-vm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.59.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "fuel-vm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.60.0"
      }, {
        "fixed" : "0.60.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FuelLabs/fuel-vm/security/advisories/GHSA-2pgj-5cv2-6xxw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FuelLabs/fuel-vm/pull/941"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FuelLabs/fuel-vm/commit/9c97c2bf782626b35ba48e154f210f91c847a513"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/FuelLabs/fuel-vm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-416" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-08T12:43:30Z",
    "nvd_published_at" : null
  }
}