# GHSA-RG2Q-2JH9-447Q: Gas mispricing in cosmwasm-vm

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2024-08-08
- Modified: 2024-08-08

## Also published as

- [RUSTSEC-2024-0361](https://cve.now/RUSTSEC-2024-0361.md) (RustSec)

## Affected versions

- cosmwasm-vm (crates.io): fixed in 1.5.6
- cosmwasm-vm (crates.io): from 2.0.0, fixed in 2.0.5
- cosmwasm-vm (crates.io): from 2.1.0, fixed in 2.1.2
- github.com/CosmWasm/wasmvm/v2 (Go): from 2.1.0, fixed in 2.1.2
- github.com/CosmWasm/wasmvm/v2 (Go): from 2.0.0, fixed in 2.0.3
- github.com/CosmWasm/wasmvm (Go): fixed in 1.5.4

## Description

**Component:** wasmvm
**Criticality:** Medium ([ACMv1](https://github.com/interchainio/security/blob/main/resources/CLASSIFICATION_MATRIX.md): 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](https://github.com/CosmWasm/cosmwasm/blob/e50490c4199a234200a497219b27f071c3409f58/docs/GAS.md#cosmwasm-gas-pricing) 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](https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2024-004.md) for more details.

## References

- https://github.com/CosmWasm/wasmvm/security/advisories/GHSA-rg2q-2jh9-447q
- https://github.com/CosmWasm/cosmwasm/commit/5bef1c588933bd60a04bb70099150cf84b69e144
- https://github.com/CosmWasm/cosmwasm/commit/9b4d6d03772b75d500a7d3c972d0d8ba6d085c06
- https://github.com/CosmWasm/cosmwasm/commit/c1313afeb261e17b1c8cf6a1eacee1da0dac42ae
- https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2024-004.md
- https://github.com/CosmWasm/wasmvm
- https://rustsec.org/advisories/RUSTSEC-2024-0361.html

Page: https://cve.now/GHSA-RG2Q-2JH9-447Q

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
