CVE-2025-66627: Wasmi Critical Use-After-Free Vulnerability

HIGH
Advisory Identifier: GHSA-g4v2-cjqp-rfmq
CVSS 8.4
CWE-416
Published
Advisory Summary

CVE-2025-66627 is a HIGH (CVSS 8.4) critical use-after-free vulnerability (CWE-416: Use After Free) affecting Wasmi libraries in the crates.io ecosystem. The issue involves critical use-after-free in wasmi's linear memory. Remediation is available by upgrading affected packages to version 0.41.2, 0.47.1, 0.51.3, 1.0.1.

CVE-2025-66627 at a Glance

CVE Identifier CVE-2025-66627
GHSA Identifier GHSA-g4v2-cjqp-rfmq
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-416: Use After Free
Affected Product Wasmi
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.4

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

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

How to Fix CVE-2025-66627

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

wasmi fixed: 0.41.2
Upgrade wasmi to 0.41.2
wasmi fixed: 0.47.1
Upgrade wasmi to 0.47.1
wasmi fixed: 0.51.3
Upgrade wasmi to 0.51.3
wasmi fixed: 1.0.1
Upgrade wasmi to 1.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 wasmi

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-66627, inspect your project dependencies for Wasmi:

inspect dependencies for wasmi

Analyze the terminal output to locate any version of Wasmi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.41.2), 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-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Wasmi, 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

### Summary A use-after-free vulnerability has been discovered in the linear memory implementation of Wasmi. This issue can be triggered by a WebAssembly module under certain memory growth conditions, potentially leading to memory corruption, information disclosure, or code execution. ### Impact - **Confidentiality:** High – attacker-controlled memory reads possible. - **Integrity:** High – memory corruption may allow arbitrary writes. - **Availability:** High – interpreter crashes possible. ### Affected Versions Wasmi `v0.41.0` through Wasmi `v1.0.0`. ### Workarounds - Upgrade to the latest patched version of Wasmi. - Consider limiting the maximum linear memory sizes where feasible. ### Credits This vulnerability was discovered by **Robert T. Morris (RTM)**.

CVE-2025-66627 Affected Wasmi Versions

4 component(s)
Fixed Versions:
0.41.20.47.10.51.31.0.1
Product / Package Ecosystem Affected Versions Fixed Version
wasmi
crates.io
≥ 0.41.0
< 0.41.2
0.41.2
wasmi
crates.io
≥ 0.42.0
< 0.47.1
0.47.1
wasmi
crates.io
≥ 0.50.0
< 0.51.3
0.51.3
wasmi
crates.io
≥ 1.0.0
< 1.0.1
1.0.1

References

Frequently Asked Questions

What is CVE-2025-66627?
CVE-2025-66627 is a security vulnerability in Wasmi involving Critical Use-After-Free in Wasmi's Linear Memory under CWE-416: Use After Free.
Which Wasmi versions are affected?
Affected versions include releases prior to 0.41.2, 0.47.1, 0.51.3, 1.0.1 across affected packages: wasmi.
What version fixes CVE-2025-66627?
Upgrading to 0.41.2, 0.47.1, 0.51.3, 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wasmi affected?
Yes, wasmi is affected in releases prior to 0.41.2, 0.47.1, 0.51.3, 1.0.1. Upgrade your dependency to 0.41.2, 0.47.1, 0.51.3, 1.0.1 or later.
What is the CVSS score of CVE-2025-66627?
CVE-2025-66627 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-66627?
CVE-2025-66627 is classified under CWE-416: Use After Free (The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.).
How can I check crates.io dependencies for CVE-2025-66627?
Run the dependency tree command: 'inspect dependencies for wasmi'. 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-g4v2-cjqp-rfmq",
  "modified" : "2025-12-09T19:17:35Z",
  "published" : "2025-12-08T22:15:49Z",
  "aliases" : [ "CVE-2025-66627" ],
  "summary" : "Critical Use-After-Free in Wasmi's Linear Memory",
  "details" : "### Summary\n\nA use-after-free vulnerability has been discovered in the linear memory implementation of Wasmi. This issue can be triggered by a WebAssembly module under certain memory growth conditions, potentially leading to memory corruption, information disclosure, or code execution.\n\n### Impact\n\n- **Confidentiality:** High – attacker-controlled memory reads possible.\n- **Integrity:** High – memory corruption may allow arbitrary writes.\n- **Availability:** High – interpreter crashes possible.\n\n### Affected Versions\n\nWasmi `v0.41.0` through Wasmi `v1.0.0`.\n\n### Workarounds\n\n- Upgrade to the latest patched version of Wasmi.\n- Consider limiting the maximum linear memory sizes where feasible.\n\n### Credits\n\nThis vulnerability was discovered by **Robert T. Morris (RTM)**.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.41.0"
      }, {
        "fixed" : "0.41.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.42.0"
      }, {
        "fixed" : "0.47.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.50.0"
      }, {
        "fixed" : "0.51.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/wasmi-labs/wasmi/security/advisories/GHSA-g4v2-cjqp-rfmq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66627"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wasmi-labs/wasmi/commit/0e6f0d2a8325602c58d6a53ce1c0e6045eb6a490"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/wasmi-labs/wasmi"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-416" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-08T22:15:49Z",
    "nvd_published_at" : "2025-12-09T16:18:21Z"
  }
}