Skip to main content

Over 150 LLM Providers · Over 5,300 Models The most extensible AI-powered pentesting platform. Open source. Star on GitHub

CVE-2022-31146

6.4 · MEDIUM
Published Jul 21, 2022 bytecodealliance CWE-416 EPSS 1.14% (64th pctl)

Overview

CVE-2022-31146 is a medium-severity vulnerability affecting bytecodealliance cranelift-codegen. It was published on July 21, 2022 and has a CVSS 3.1 base score of 6.4 (MEDIUM).

This vulnerability has a CVSS 3.1 base score of 6.4, rated MEDIUM. It can be exploited remotely over the network. Some level of privileges is required for exploitation.

Technical Description

Wasmtime is a standalone runtime for WebAssembly. There is a bug in the Wasmtime's code generator, Cranelift, where functions using reference types may be incorrectly missing metadata required for runtime garbage collection. This means that if a GC happens at runtime then the GC pass will mistakenly think these functions do not have live references to GC'd values, reclaiming them and deallocating them. The function will then subsequently continue to use the values assuming they had not been GC'd, leading later to a use-after-free. This bug was introduced in the migration to the `regalloc2` register allocator that occurred in the Wasmtime 0.37.0 release on 2022-05-20. This bug has been patched and users should upgrade to Wasmtime version 0.38.2. Mitigations for this issue can be achieved by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types` or downgrading to Wasmtime 0.36.0 or prior.

Remediation

Check the references section for vendor advisories and patches from bytecodealliance. Update cranelift-codegen to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Affected Products

Vendor Product Versions Status
bytecodealliance cranelift-codegen >= 0.84.0, < 0.85.2 Affected
bytecodealliance wasmtime >= 0.37.0, < 0.38.2 Affected

Frequently Asked Questions

What is CVE-2022-31146?

CVE-2022-31146 is a medium-severity vulnerability affecting bytecodealliance cranelift-codegen. It was published on July 21, 2022 and has a CVSS 3.1 base score of 6.4 (MEDIUM).

How severe is CVE-2022-31146?

This vulnerability has a CVSS 3.1 base score of 6.4, rated MEDIUM. It can be exploited remotely over the network. Some level of privileges is required for exploitation.

How do I fix or remediate CVE-2022-31146?

Check the references section for vendor advisories and patches from bytecodealliance. Update cranelift-codegen to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2022-31146?

CyberStrike's AI-powered security agents can automatically detect CVE-2022-31146 across your infrastructure using autonomous pentesting, DAST scanning, and HackBrowser. The platform continuously monitors for known vulnerabilities and provides actionable remediation guidance prioritized by real-world exploitability.