# GHSA-2pgj-5cv2-6xxw: FuelVM is vulnerable to heap memory allocation re-use bug

> Attackers can read sensitive data from other smart contracts due to improper memory deallocation in FuelVM, violating isolation guarantees.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Oct 2025

## What is GHSA-2pgj-5cv2-6xxw?

GHSA-2pgj-5cv2-6xxw is a vulnerability in fuel-vm, published on 8 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### 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)

## Which versions are affected by GHSA-2pgj-5cv2-6xxw?

4 open source packages ship an affected version, including fuel-vm.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `fuel-vm` | crates.io | All versions | 0.59.3 |
| `fuel-vm` | crates.io | All versions | 0.59.3 |
| `fuel-vm` | crates.io | From 0.60.0 | 0.60.1 |
| `fuel-vm` | crates.io | From 0.60.0 | 0.60.1 |

## How do I fix GHSA-2pgj-5cv2-6xxw?

Upgrade fuel-vm to a fixed version for your release line: 0.59.3 or 0.60.1.

## Is GHSA-2pgj-5cv2-6xxw being exploited?

There is no known exploitation of GHSA-2pgj-5cv2-6xxw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2pgj-5cv2-6xxw and fix it if it is affected.

What it is: GHSA-2pgj-5cv2-6xxw is a vulnerability in fuel-vm, published on 8 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-2pgj-5cv2-6xxw in the wild and no public exploit code.

Affected packages and fixed versions:
- fuel-vm (crates.io): affected all versions; fixed in 0.59.3
- fuel-vm (crates.io): affected all versions; fixed in 0.59.3
- fuel-vm (crates.io): affected from 0.60.0; fixed in 0.60.1
- fuel-vm (crates.io): affected from 0.60.0; fixed in 0.60.1

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/GHSA-2pgj-5cv2-6xxw/ (Markdown: https://insights.sbomify.com/GHSA-2pgj-5cv2-6xxw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2pgj-5cv2-6xxw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2pgj-5cv2-6xxw/
Summaries are generated and may contain mistakes; the official description above is the record.
