
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2021-32629 is a critical vulnerability discovered in Cranelift, an open-source code generator maintained by Bytecode Alliance. The vulnerability was introduced in the new backend on September 8, 2020, and first included in release 0.73.0. The bug affects the Cranelift x64 backend and could potentially result in a sandbox escape in a WebAssembly program (GitHub Advisory, Fastly Advisory).
The vulnerability stems from a code generation flaw where the system 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 another optimization where the instruction selector elides a 32-to-64-bit zero-extend operator. The issue occurs under specific circumstances: when an i32 value is greater than or equal to 0x8000_0000, the value is spilled and reloaded by the register allocator, and the value is produced by special instructions (add, sub, mul, and, or) that zero the upper 32 bits of the destination (GitHub Advisory).
If exploited, the vulnerability could allow access to memory addresses up to 2GiB before the start of the WebAssembly module heap. For heap bounds larger than 2GiB, it would be possible to read memory from a computable range dependent on the heap's bound size. This could potentially lead to sandbox escape and unauthorized memory access. The severity of the impact depends on the heap implementation, particularly if the heap has bounds checks and doesn't rely exclusively on guard pages (GitHub Advisory).
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 versions prior to 0.73.0 should update if they were not using the old default backend. For systems unable to upgrade immediately, the vulnerability's impact can be mitigated by ensuring there is no memory mapped in the accessible range, for example, by maintaining a 2 GiB guard region before the WebAssembly module heap (GitHub Advisory).
The vulnerability was discovered through collaborative efforts between industry and academia. It was identified by developers at Fastly following a report from Javier Cabrera Arteaga of KTH Royal Institute of Technology, with support from project Trustful of Stiftelsen för Strategisk Forskning. Fastly conducted a thorough investigation and confirmed that no WebAssembly modules in their Compute@Edge platform were crafted to exploit this bug (Fastly Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."