CVE-2024-28123: Wasmi Wasmi Out-of-bounds Write For Host Vulnerability
HIGHCVE-2024-28123 is a HIGH (CVSS 7.3) wasmi out-of-bounds write for host vulnerability (CWE-787: Out-of-bounds Write) affecting Wasmi libraries in the crates.io ecosystem. The issue involves wasmi out-of-bounds write for host to wasm calls with more than 128 parameters. Remediation is available by upgrading affected packages to version 0.31.1.
CVE-2024-28123 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2024-28123
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.
Upgrade wasmi to 0.31.1
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-2024-28123, 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.31.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-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. 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
CVE-2024-28123 Affected Wasmi Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wasmi
|
crates.io |
≥ 0.15.0
< 0.31.1
|
0.31.1
|
References
Frequently Asked Questions
What is CVE-2024-28123?
Which Wasmi versions are affected?
What version fixes CVE-2024-28123?
Is wasmi affected?
What is the CVSS score of CVE-2024-28123?
What CWE is associated with CVE-2024-28123?
How can I check crates.io dependencies for CVE-2024-28123?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-75jp-vq8x-h4cq",
"modified" : "2025-06-04T00:35:09Z",
"published" : "2024-03-07T17:26:27Z",
"aliases" : [ "CVE-2024-28123" ],
"summary" : "Wasmi Out-of-bounds Write for host to Wasm calls with more than 128 Parameters",
"details" : "### Summary\n\nIn the WASMI Interpreter, an [Out-of-bounds Buffer Write](https://cwe.mitre.org/data/definitions/787.html) will arise arise if the host calls or resumes a Wasm function with more parameters than the default limit (128), as it will surpass the stack value. This doesn’t affect calls from Wasm to Wasm, only from host to Wasm.\n\n### Impact\n\nAfter conducting an analysis of the dependent Polkadot systems of `wasmi`: [Pallet Contracts](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/contracts), [Parity Signer](https://github.com/paritytech/parity-signer), and [Smoldot](https://github.com/smol-dot/smoldot), we have found that none on those systems have been affected by the issue as they are calling host to Wasm function with a small limited amount of parameters always. \n\n### Mitigations\n\nIf you are using `wasmi` betwen version 0.15.0 and 0.31.0, please update it to the [0.31.1](https://github.com/paritytech/wasmi/releases/tag/v0.31.1) patch release that we just published.\n\n### Workarounds\n\nEnsure no more than 128 parameters can be pass in a call from the host to a Wasm function. \n\n### References\n\nPatch PR: <PR>\n\n### Special thanks\n\nSpecial thanks to Stellar Development Foundation for reporting this security vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "wasmi"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.15.0"
}, {
"fixed" : "0.31.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.31.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/wasmi-labs/wasmi/security/advisories/GHSA-75jp-vq8x-h4cq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28123"
}, {
"type" : "WEB",
"url" : "https://github.com/wasmi-labs/wasmi/commit/f7b3200e9f3dc9e2cbca966cb255c228453c792f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/wasmi-labs/wasmi"
}, {
"type" : "WEB",
"url" : "https://github.com/wasmi-labs/wasmi/releases/tag/v0.31.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-787" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-07T17:26:27Z",
"nvd_published_at" : "2024-03-21T02:52:23Z"
}
}