GHSA-rg2q-2jh9-447q Gas mispricing in cosmwasm-vm

Not scored Published

A malicious smart contract can cause a blockchain denial of service by exploiting gas mispricing in the CosmWasm VM library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-rg2q-2jh9-447q?

GHSA-rg2q-2jh9-447q is a denial of service vulnerability in github.com/CosmWasm/wasmvm, published on 8 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Component: wasmvm Criticality: Medium (ACMv1: I:Moderate; L:Likely) Patched versions: wasmvm 1.5.4, 2.0.3, 2.1.2

Some Wasm operations take significantly more gas than our benchmarks indicated. This can lead to missing the gas target we defined by a factor of ~10x. This means a malicious contract could take 10 times as much time to execute as expected, which can be used to temporarily DoS a chain.

See CWA-2024-004 for more details.

Which versions are affected by GHSA-rg2q-2jh9-447q?

13 open source packages ship an affected version, including github.com/CosmWasm/wasmvm/v2, github.com/CosmWasm/wasmvm and cosmwasm-vm.

PackageAffectedFixed in
github.com/CosmWasm/wasmvm/v2 GoFrom 2.0.02.0.3
github.com/CosmWasm/wasmvm/v2 GoFrom 2.0.02.0.3
github.com/CosmWasm/wasmvm/v2 GoFrom 2.1.02.1.2
github.com/CosmWasm/wasmvm/v2 GoFrom 2.1.02.1.2
github.com/CosmWasm/wasmvm GoAll versions1.5.4
github.com/CosmWasm/wasmvm GoAll versions1.5.4
7 more packages
cosmwasm-vm crates.ioAll versions1.5.6
cosmwasm-vm crates.ioAll versions1.5.6
cosmwasm-vm crates.ioFrom 0.0.0-01.5.7, 2.0.6, 2.1.3
cosmwasm-vm crates.ioFrom 2.0.02.0.5
cosmwasm-vm crates.ioFrom 2.0.02.0.5
cosmwasm-vm crates.ioFrom 2.1.02.1.2
cosmwasm-vm crates.ioFrom 2.1.02.1.2

How do I fix GHSA-rg2q-2jh9-447q?

Upgrade github.com/CosmWasm/wasmvm/v2 to a fixed version for your release line: 2.0.3 or 2.1.2.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is GHSA-rg2q-2jh9-447q being exploited?

There is no known exploitation of GHSA-rg2q-2jh9-447q in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2024-0361.

Is GHSA-rg2q-2jh9-447q in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free