p PatchFirst

CVE-2022-24791

CVE-2022-24791 · Use after free in Wasmtime

This page contains facts from public vulnerability sources. Check the original advisory before updating.

Wasmtime is a standalone JIT-style runtime for WebAssembly, using Cranelift. There is a use after free vulnerability in Wasmtime when both running Wasm that uses externrefs and enabling epoch interruption in Wasmtime. If you are not explicitly enabling epoch interruption (it is disabled by default) then you are not affected. If you are explicitly disabling the Wasm reference types proposal (it is enabled by default) then you are also not affected. The use after free is caused by Cranelift failing to emit stack maps when there are safepoints inside cold blocks. Cold blocks occur when epoch interruption is enabled. Cold blocks are emitted at the end of compiled functions, and change the order blocks are emitted versus defined. This reordering accidentally caused Cranelift to skip emitting some stack maps because it expected to emit the stack maps in block definition order, rather than block emission order. When Wasmtime would eventually collect garbage, it would fail to find live references on the stack because of the missing stack maps, think that they were unreferenced garbage, and therefore reclaim them. Then after the collection ended, the Wasm code could use the reclaimed-too-early references, which is a use after free. Patches have been released in versions 0.34.2 and 0.35.2, which fix the vulnerability. All Wasmtime users are recommended to upgrade to these patched versions. If upgrading is not an option for you at this time, you can avoid the vulnerability by either: disabling the Wasm reference types proposal, config.wasm_reference_types(false); or by disabling epoch interruption if you were previously enabling it. config.epoch_interruption(false).

CVSS 8.1 · High · EPSS 1.2% · Fix available

Published
Updated

Stack: system

Affected products and versions

  • wasmtime

    Versions
    • < 0.34.2: Affected
    • >= 0.35.0, < 0.35.2: Affected

    No fix published

  • mozjs52 Ubuntu:18.04:LTS

    Versions
    • 52.3.1-0ubuntu3
    • 52.3.1-7fakesync1
    • 52.8.1-0ubuntu0.18.04.1
    • 52.9.1-0ubuntu0.18.04.1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • mozjs38 Ubuntu:18.04:LTS

    Versions
    • 38.8.0~repack1-0ubuntu1
    • 38.8.0~repack1-0ubuntu3
    • 38.8.0~repack1-0ubuntu4
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • mozjs68 Ubuntu:20.04:LTS

    Versions
    • 68.5.0-1~fakesync
    • 68.5.0-2~fakesync
    • 68.6.0-1
    • 68.6.0-1ubuntu1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • mozjs52 Ubuntu:20.04:LTS

    Versions
    • 52.9.1-1build1
    • 52.9.1-1ubuntu3
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • firefox Ubuntu:22.04:LTS

    Versions
    • 93.0+build1-0ubuntu3
    • 94.0+build3-0ubuntu1
    • 94.0.2+build1-0ubuntu1
    • 94.0.2+build2-0ubuntu1
    • 95.0+build1-0ubuntu1
    • 95.0.1+build2-0ubuntu1
    • 95.0.2+build1-0ubuntu1
    • 96.0+build2-0ubuntu1
    • 96.0.1+build1-0ubuntu1
    • 96.0.2+build1-0ubuntu1
    • 96.0.3+build1-0ubuntu1
    • 97.0+build1-0ubuntu1
    • 97.0+build2-0ubuntu1
    • 97.0.1+build1-0ubuntu1
    Affected ranges
    • ECOSYSTEM: < 1:1snap1-0ubuntu1

    Update to 1:1snap1-0ubuntu1

  • mozjs78 Ubuntu:22.04:LTS

    Versions
    • 78.13.0-1
    • 78.15.0-2
    • 78.15.0-4ubuntu1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • mozjs91 Ubuntu:22.04:LTS

    Versions
    • 91.5.1-0ubuntu1
    • 91.6.0-1
    • 91.6.0-2
    • 91.7.0-2
    • 91.10.0-0ubuntu1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • thunderbird Ubuntu:22.04:LTS

    Versions
    • 1:91.1.2+build1-0ubuntu1
    • 1:91.3.0+build2-0ubuntu1
    • 1:91.3.1+build1-0ubuntu1
    • 1:91.3.2+build1-0ubuntu1
    • 1:91.4.0+build1.1-0ubuntu1
    • 1:91.4.0+build2-0ubuntu1
    • 1:91.5.0+build1-0ubuntu1
    • 1:91.5.1+build1-0ubuntu1
    • 1:91.6.1+build1-0ubuntu1
    • 1:91.7.0+build1-0ubuntu1
    • 1:91.7.0+build2-0ubuntu1
    • 1:91.8.0+build2-0ubuntu1
    • 1:91.9.1+build1-0ubuntu0.22.04.1
    • 1:91.11.0+build2-0ubuntu0.22.04.1
    • 1:102.2.2+build1-0ubuntu0.22.04.1
    • 1:102.4.2+build2-0ubuntu0.22.04.1
    • 1:102.7.1+build2-0ubuntu0.22.04.1
    • 1:102.8.0+build2-0ubuntu0.22.04.1
    • 1:102.9.0+build1-0ubuntu0.22.04.1
    • 1:102.10.0+build2-0ubuntu0.22.04.1
    • 1:102.11.0+build1-0ubuntu0.22.04.1
    • 1:102.13.0+build1-0ubuntu0.22.04.1
    • 1:102.15.0+build1-0ubuntu0.22.04.1
    • 1:102.15.1+build1-0ubuntu0.22.04.1
    • 1:115.3.1+build1-0ubuntu0.22.04.2
    • 1:115.4.1+build1-0ubuntu0.22.04.1
    • 1:115.5.0+build1-0ubuntu0.22.04.1
    • 1:115.6.0+build2-0ubuntu0.22.04.1
    • 1:115.8.1+build1-0ubuntu0.22.04.1
    • 1:115.9.0+build1-0ubuntu0.22.04.1
    • 1:115.10.1+build1-0ubuntu0.22.04.1
    • 1:115.11.0+build2-0ubuntu0.22.04.1
    • 1:115.12.0+build3-0ubuntu0.22.04.1
    • 1:115.13.0+build5-0ubuntu0.22.04.1
    • 1:115.15.0+build1-0ubuntu0.22.04.1
    • 1:115.16.0+build2-0ubuntu0.22.04.1
    • 1:115.18.0+build1-0ubuntu0.22.04.1
    • 1:128.12.0+build1-0ubuntu0.22.04.1
    • 1:140.7.1+build1-0ubuntu0.22.04.1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • thunderbird Ubuntu:24.04:LTS

    Versions
    • 1:115.3.1+build1-0ubuntu1
    • 1:115.4.1+build1-0ubuntu1
    • 1:115.4.3+build1-0ubuntu1
    • 1:115.5.0+build1-0ubuntu1
    • 1:115.5.1+build1-0ubuntu1
    • 1:115.5.2+build2-0ubuntu1
    • 1:115.6.0+build1-0ubuntu1
    • 1:115.6.0+build2-0ubuntu1
    • 1:115.6.1+build1-0ubuntu1
    • 1:115.8.0+build1-0ubuntu1
    • 1:115.8.1+build1+snap2
    • 1:115.8.1+build1+snap3
    • 2:1snap1-0ubuntu1
    • 2:1snap1-0ubuntu3
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →