GHSA-rg2q-2jh9-447q: Cosmwasm vm Gas Mispricing Vulnerability
MODERATEGHSA-rg2q-2jh9-447q is a MODERATE (CVSS 4.3) gas mispricing vulnerability (CWE-920: Improper Restriction of Power Consumption) affecting Cosmwasm vm libraries in the crates.io ecosystem. The issue involves gas mispricing in cosmwasm-vm. Remediation is available by upgrading affected packages to version 1.5.6, 2.0.5, 2.1.2, 2.0.3, 1.5.4.
GHSA-rg2q-2jh9-447q at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).
How to Fix GHSA-rg2q-2jh9-447q
To remediate this vulnerability, upgrade all affected Cosmwasm vm 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 cosmwasm-vm to 1.5.6
Upgrade cosmwasm-vm to 2.0.5
Upgrade cosmwasm-vm to 2.1.2
Upgrade github.com/CosmWasm/wasmvm/v2 to 2.1.2
Upgrade github.com/CosmWasm/wasmvm/v2 to 2.0.3
Upgrade github.com/CosmWasm/wasmvm to 1.5.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for cosmwasm-vm
How to Check if You Are Affected
To determine whether your application is affected by GHSA-rg2q-2jh9-447q, inspect your project dependencies for Cosmwasm vm:
inspect dependencies for cosmwasm-vm
Analyze the terminal output to locate any version of Cosmwasm vm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.6), 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-920: Improper Restriction of Power Consumption, where the product operates in an environment in which power is a limited resource that cannot be automatically replenished, but the product does not properly restrict the amount of power that its operation consumes. In Cosmwasm vm, 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
GHSA-rg2q-2jh9-447q Affected Cosmwasm vm Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cosmwasm-vm
|
crates.io |
< 1.5.6
|
1.5.6
|
|
cosmwasm-vm
|
crates.io |
≥ 2.0.0
< 2.0.5
|
2.0.5
|
|
cosmwasm-vm
|
crates.io |
≥ 2.1.0
< 2.1.2
|
2.1.2
|
|
github.com/CosmWasm/wasmvm/v2
|
Go |
≥ 2.1.0
< 2.1.2
|
2.1.2
|
|
github.com/CosmWasm/wasmvm/v2
|
Go |
≥ 2.0.0
< 2.0.3
|
2.0.3
|
|
github.com/CosmWasm/wasmvm
|
Go |
< 1.5.4
|
1.5.4
|
References
Frequently Asked Questions
What is GHSA-rg2q-2jh9-447q?
Which Cosmwasm vm versions are affected?
What version fixes GHSA-rg2q-2jh9-447q?
Is cosmwasm-vm affected?
Is github.com/CosmWasm/wasmvm/v2 affected?
What is the CVSS score of GHSA-rg2q-2jh9-447q?
What CWE is associated with GHSA-rg2q-2jh9-447q?
How can I check crates.io dependencies for GHSA-rg2q-2jh9-447q?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rg2q-2jh9-447q",
"modified" : "2024-08-08T17:03:07Z",
"published" : "2024-08-08T16:30:50Z",
"aliases" : [ ],
"summary" : "Gas mispricing in cosmwasm-vm",
"details" : "**Component:** wasmvm\n**Criticality:** Medium ([ACMv1](https://github.com/interchainio/security/blob/main/resources/CLASSIFICATION_MATRIX.md): I:Moderate; L:Likely)\n**Patched versions:** wasmvm 1.5.4, 2.0.3, 2.1.2\n\nSome 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.\n\nSee [CWA-2024-004](https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2024-004.md) for more details.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "cosmwasm-vm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "cosmwasm-vm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "cosmwasm-vm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/CosmWasm/wasmvm/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/CosmWasm/wasmvm/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/CosmWasm/wasmvm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/CosmWasm/wasmvm/security/advisories/GHSA-rg2q-2jh9-447q"
}, {
"type" : "WEB",
"url" : "https://github.com/CosmWasm/cosmwasm/commit/5bef1c588933bd60a04bb70099150cf84b69e144"
}, {
"type" : "WEB",
"url" : "https://github.com/CosmWasm/cosmwasm/commit/9b4d6d03772b75d500a7d3c972d0d8ba6d085c06"
}, {
"type" : "WEB",
"url" : "https://github.com/CosmWasm/cosmwasm/commit/c1313afeb261e17b1c8cf6a1eacee1da0dac42ae"
}, {
"type" : "WEB",
"url" : "https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2024-004.md"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/CosmWasm/wasmvm"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0361.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-920" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-08T16:30:50Z",
"nvd_published_at" : null
}
}