Learn about CVE-2022-39392 affecting Wasmtime, allowing out-of-bounds read/write operations due to misconfigured memory settings. Upgrade to Wasmtime 2.0.2 to mitigate the vulnerability.
Wasmtime is a standalone runtime for WebAssembly that was found vulnerable to out of bounds read/write with zero-memory-pages configuration.
Understanding CVE-2022-39392
This CVE describes a bug in Wasmtime's pooling instance allocator that allows out of bounds read/write operations when configured with zero pages of memory for WebAssembly instances.
What is CVE-2022-39392?
The bug in Wasmtime's version prior to 2.0.2 allows malicious actors to read/write memory outside the wasm sandbox due to improper virtual memory mapping configurations.
The Impact of CVE-2022-39392
The bug poses a high impact on confidentiality and integrity, with a CVSS base score of 5.9 (Medium severity). It requires high privileges and complexity for exploitation.
Technical Details of CVE-2022-39392
The vulnerability arises from the pooling instance allocator misconfiguration, leading to out of bounds reads/writes.
Vulnerability Description
The bug allows reading/writing of memory unrelated to the wasm sandbox within range of the base address of the memory mapping created by the pooling allocator.
Affected Systems and Versions
Exploitation Mechanism
The bug can be triggered by setting
InstanceLimits::memory_pages
to zero, a rare configuration applied to prevent wasm modules from allocating linear memory.
Mitigation and Prevention
To mitigate the vulnerability, users should upgrade to Wasmtime 2.0.2 or higher and avoid setting
memory_pages
to zero.
Immediate Steps to Take
Upgrade to Wasmtime 2.0.2 and configure the pooling allocator with a non-zero
memory_pages
allotment.
Long-Term Security Practices
Regularly update Wasmtime to the latest version and follow secure configuration practices.
Patching and Updates
Ensure timely installation of patches and updates to mitigate known vulnerabilities.