CVE-2024-30266: Wasmtime Wasmtime Vulnerable To Panic When Vulnerability

LOW
Advisory Identifier: GHSA-75hq-h6g9-h4q5
CVSS 3.3
CWE-843
Published
Advisory Summary

CVE-2024-30266 is a LOW (CVSS 3.3) wasmtime vulnerable to panic when vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Wasmtime libraries in the crates.io ecosystem. The issue involves wasmtime vulnerable to panic when using a dropped extenref-typed element segment. Remediation is available by upgrading affected packages to version 19.0.1.

CVE-2024-30266 at a Glance

CVE Identifier CVE-2024-30266
GHSA Identifier GHSA-75hq-h6g9-h4q5
Severity LOW
CVSS v3.1 Base Score 3.3
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Wasmtime
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 3.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-30266

To remediate this vulnerability, upgrade all affected Wasmtime dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wasmtime fixed: 19.0.1
Upgrade wasmtime to 19.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for wasmtime

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-30266, inspect your project dependencies for Wasmtime:

inspect dependencies for wasmtime

Analyze the terminal output to locate any version of Wasmtime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 19.0.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Wasmtime, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The 19.0.0 release of Wasmtime contains a regression introduced during its development which can lead to a guest WebAssembly module causing a panic in the host runtime. A valid WebAssembly module, when executed at runtime, may cause this panic. The panic in question is caused when a WebAssembly module issues a `table.*` instruction which uses a dropped element segment with a table that also has an `externref` type. This causes Wasmtime to erroneously use an empty function segment instead of an empty externref segment to perform this operation. This mismatch in types causes a panic in Wasmtime when it's asserted that an externref table is only viewed as externrefs. This regression was introduced during the development of the 19.0.0 release and only affects the 19.0.0 release. This panic requires the `reference-types` WebAssembly feature to be enabled, and it is enabled by default. Toolchains are not known to generate this pattern by default so it's likely a module would need to be specifically crafted to trigger this panic. A panic in a host runtime represents a possible denial-of-service in some scenarios. This panic cannot introduce memory unsafety or allow WebAssembly to break outside of its sandbox, however. There is no possible heap corruption or memory unsafety from this panic. ### Patches Wasmtime 19.0.1 has been released to fix this problem. Users of 19.0.0 should upgrade to 19.0.1. All other versions of Wasmtime are not affected by this issue. ### Workarounds If upgrading is not possible it's recommended to use `config.reference_types(false)`. That will disable these modules at validation-time which prevents the possibility of a panic at runtime. If reference-types are required, however, then there is no other workaround at this time other than upgrading. ### References * [Original bug report](https://github.com/bytecodealliance/wasmtime/issues/8281) * [PR to fix the bug](https://github.com/bytecodealliance/wasmtime/pull/8283) * [PR that introduced the bug](https://github.com/bytecodealliance/wasmtime/pull/8018)

CVE-2024-30266 Affected Wasmtime Versions

1 component(s)
Fixed Versions:
19.0.1
Product / Package Ecosystem Affected Versions Fixed Version
wasmtime
crates.io
≥ 19.0.0
< 19.0.1
All 1 versions
19.0.0
19.0.1

References

Frequently Asked Questions

What is CVE-2024-30266?
CVE-2024-30266 is a security vulnerability in Wasmtime involving Wasmtime vulnerable to panic when using a dropped extenref-typed element segment under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Wasmtime versions are affected?
Affected versions include releases prior to 19.0.1 across affected packages: wasmtime.
What version fixes CVE-2024-30266?
Upgrading to 19.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wasmtime affected?
Yes, wasmtime is affected in releases prior to 19.0.1. Upgrade your dependency to 19.0.1 or later.
What is the CVSS score of CVE-2024-30266?
CVE-2024-30266 has a CVSS v3.1 base score of 3.3 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-30266?
CVE-2024-30266 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check crates.io dependencies for CVE-2024-30266?
Run the dependency tree command: 'inspect dependencies for wasmtime'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-75hq-h6g9-h4q5",
  "modified" : "2025-05-02T12:54:52Z",
  "published" : "2024-04-02T21:09:23Z",
  "aliases" : [ "CVE-2024-30266" ],
  "summary" : "Wasmtime vulnerable to panic when using a dropped extenref-typed element segment",
  "details" : "### Impact\n\nThe 19.0.0 release of Wasmtime contains a regression introduced during its development which can lead to a guest WebAssembly module causing a panic in the host runtime. A valid WebAssembly module, when executed at runtime, may cause this panic. The panic in question is caused when a WebAssembly module issues a `table.*` instruction which uses a dropped element segment with a table that also has an `externref` type. This causes Wasmtime to erroneously use an empty function segment instead of an empty externref segment to perform this operation. This mismatch in types causes a panic in Wasmtime when it's asserted that an externref table is only viewed as externrefs.\n\nThis regression was introduced during the development of the 19.0.0 release and only affects the 19.0.0 release. This panic requires the `reference-types` WebAssembly feature to be enabled, and it is enabled by default. Toolchains are not known to generate this pattern by default so it's likely a module would need to be specifically crafted to trigger this panic.\n\nA panic in a host runtime represents a possible denial-of-service in some scenarios. This panic cannot introduce memory unsafety or allow WebAssembly to break outside of its sandbox, however. There is no possible heap corruption or memory unsafety from this panic.\n\n### Patches\n\nWasmtime 19.0.1 has been released to fix this problem. Users of 19.0.0 should upgrade to 19.0.1. All other versions of Wasmtime are not affected by this issue.\n\n### Workarounds\n\nIf upgrading is not possible it's recommended to use `config.reference_types(false)`. That will disable these modules at validation-time which prevents the possibility of a panic at runtime. If reference-types are required, however, then there is no other workaround at this time other than upgrading.\n\n### References\n\n* [Original bug report](https://github.com/bytecodealliance/wasmtime/issues/8281)\n* [PR to fix the bug](https://github.com/bytecodealliance/wasmtime/pull/8283)\n* [PR that introduced the bug](https://github.com/bytecodealliance/wasmtime/pull/8018)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0"
      }, {
        "fixed" : "19.0.1"
      } ]
    } ],
    "versions" : [ "19.0.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-75hq-h6g9-h4q5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-30266"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/issues/8281"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/pull/8018"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/pull/8283"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/commit/7f57d0bb0948fa56cc950278d0db230ed10e8664"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bytecodealliance/wasmtime"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0441.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-02T21:09:23Z",
    "nvd_published_at" : "2024-04-04T16:15:09Z"
  }
}