CVEfocus › CVE database › CVE-2022-39392

CVE-2022-39392Wasmtime vulnerable to out of bounds read/write with zero-memory-pages configuration

CVSS 5.9 MediumEPSS 0.8% (higher than 53% of CVEs)Published 2022-11-10Updated 2025-04-23Assigner: GitHub_M

Wasmtime is a standalone runtime for WebAssembly. Prior to version 2.0.2, there is a bug in Wasmtime's implementation of its pooling instance allocator when the allocator is configured to give WebAssembly instances a maximum of zero pages of memory. In this configuration, the virtual memory mapping for WebAssembly memories did not meet the compiler-required configuration requirements for safely executing WebAssembly modules. Wasmtime's default settings require virtual memory page faults to indicate that wasm reads/writes are out-of-bounds, but the pooling allocator's configuration would not create an appropriate virtual memory mapping for this meaning out of bounds reads/writes can successfully read/write memory unrelated to the wasm sandbox within range of the base address of the memory mapping created by the pooling allocator. This bug is not applicable with the default settings of the `wasmtime` crate. This bug can only be triggered by setting `InstanceLimits::memory_pages` to zero. This is expected to be a very rare configuration since this means that wasm modules cannot allocate any pages of linear memory. All wasm modules produced by all current toolchains are highly likely to use linear memory, so it's expected to be unlikely that this configuration is set to zero by any production embedding of Wasmtime. This bug has been patched and users should upgrade to Wasmtime 2.0.2. This bug can be worked around by increasing the `memory_pages` allotment when configuring the pooling allocator to a value greater than zero. If an embedding wishes to still prevent memory from actually being used then the `Store::limiter` method can be used to dynamically disallow growth of memory beyond 0 bytes large. Note that the default `memory_pages` value is greater than zero.

CWE-119CWE-125CWE-787

What to do

Fixed builds are available from crates.io: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
16Will not fix
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04firefoxNot affected
vulnerable_code_not_present
Ubuntu 24.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 22.04firefoxNot affected
vulnerable_code_not_present
Ubuntu 22.04mozjs78Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 22.04mozjs91Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 22.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 20.04firefoxWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 20.04mozjs52Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 20.04mozjs68Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 20.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 18.04firefoxWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 18.04mozjs38Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 18.04mozjs52Will not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
UBUNTU-CVE-2022-39392
Ubuntu 18.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 16.04firefoxWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 16.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 14.04firefoxWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
Ubuntu 14.04thunderbirdWill not fix
mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap
crates.io librarywasmtimeFixed1.0.2RUSTSEC-2022-0102

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.