GHSA-75jp-vq8x-h4cq

Suggest an improvement
Source
https://github.com/advisories/GHSA-75jp-vq8x-h4cq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/03/GHSA-75jp-vq8x-h4cq/GHSA-75jp-vq8x-h4cq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-75jp-vq8x-h4cq
Aliases
Published
2024-03-07T17:26:27Z
Modified
2024-03-07T17:41:42.850690Z
Summary
Wasmi Out-of-bounds Write for host to Wasm calls with more than 128 Parameters
Details

Summary

In the WASMI Interpreter, an Out-of-bounds Buffer Write 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.

Impact

After conducting an analysis of the dependent Polkadot systems of wasmi: Pallet Contracts, Parity Signer, and 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.

Mitigations

If you are using wasmi betwen version 0.15.0 and 0.31.0, please update it to the 0.31.1 patch release that we just published.

Workarounds

Ensure no more than 128 parameters can be pass in a call from the host to a Wasm function.

References

Patch PR: <PR>

Special thanks

Special thanks to Stellar Development Foundation for reporting this security vulnerability.

References

Affected packages

crates.io / wasmi

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.15.0
Fixed
0.31.1

Database specific

{
    "last_known_affected_version_range": "<= 0.31.0"
}