Vulnerability DatabaseRUSTSEC-2021-0067

RUSTSEC-2021-0067
Rust vulnerability analysis and mitigation

Overview

A critical vulnerability (RUSTSEC-2021-0067/CVE-2021-32629) was discovered in Cranelift's x64 backend affecting versions <= 0.73.0. The vulnerability, discovered in May 2021, involves a code generation flaw that could potentially lead to a WebAssembly module sandbox escape. The bug was introduced in the new backend on September 8, 2020, and was first included in a release on September 30, 2020, though the new backend wasn't the default prior to version 0.73.0 (GitHub Advisory).

Technical details

The vulnerability stems from a bug that performs a sign-extend instead of a zero-extend on a value loaded from the stack when the register allocator reloads a spilled integer value narrower than 64 bits. This interacts with an optimization where the instruction selector elides a 32-to-64-bit zero-extend operator when an instruction producing a 32-bit value zeros the upper 32 bits of its destination register. The issue manifests when specific conditions are met: an i32 value is >= 0x8000_0000, the value is spilled and reloaded due to high register pressure, the value is produced by special instructions (add, sub, mul, and, or) that zero upper 32 bits, the value is zero-extended to 64 bits, and the resulting 64-bit value is used (GitHub Advisory).

Impact

When exploited, this vulnerability could allow access to memory addresses up to 2GiB before the start of the heap allocated for the WebAssembly module. If the heap bound is larger than 2GiB, it becomes possible to read memory from a computable range dependent on the heap's bound size. The impact varies based on heap implementation, particularly affecting systems where the heap has bounds checks and doesn't rely exclusively on guard pages, and where the heap bound is 2GiB or smaller (GitHub Advisory).

Mitigation and workarounds

Users of Cranelift version 0.73.0 should upgrade to either version 0.73.1 or 0.74.0 to remediate this vulnerability. Users of Cranelift versions prior to 0.73.0 should update to 0.73.1 or 0.74 if they were not using the old default backend. The vulnerability's impact can be mitigated if there is no memory mapped in the range accessible using this bug, for example, if there is a 2 GiB guard region before the WebAssembly module heap (GitHub Advisory).

Community reactions

The bug was identified by developers at Fastly following a report from Javier Cabrera Arteaga at KTH Royal Institute of Technology, with support from project Trustful of Stiftelsen för Strategisk Forskning. Fastly committed to publishing a related Security Advisory to provide additional information about the vulnerability (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-2fjw-whxm-9v4qCRITICAL9.3
  • RustRust
  • nftnl
NoYesNov 25, 2025
CVE-2025-66017HIGH8.2
  • RustRust
  • cggmp21
NoYesNov 25, 2025
GHSA-mj73-j457-8x9qLOW2.7
  • RustRust
  • maxminddb
NoYesDec 02, 2025
GHSA-pq5v-rwp8-p7gmLOW2.7
  • RustRust
  • rtvm-interpreter
NoNoDec 02, 2025
RUSTSEC-2025-0132N/AN/A
  • RustRust
  • maxminddb
NoYesNov 28, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management