# GHSA-75qh-gg76-p2w4: CWA-2023-004: Excessive number of function parameters in compiled Wasm

> Attackers can cause denial of service and lock the VM by submitting crafted Wasm files with excessive parameters.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Aug 2024
- **Also known as:** GO-2024-3101, RUSTSEC-2024-0366

## What is GHSA-75qh-gg76-p2w4?

GHSA-75qh-gg76-p2w4 is a denial of service vulnerability in github.com/CosmWasm/wasmvm, published on 27 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A specifically crafted Wasm file can cause the VM to consume excessive amounts of memory when compiling a contract.
This can lead to high memory usage, slowdowns, potentially a crash and can poison a lock in the VM,
preventing any further interaction with contracts.

For more information, see [CWA-2023-004](https://github.com/CosmWasm/advisories/blob/main/CWAs/CWA-2023-004.md).

## Which versions are affected by GHSA-75qh-gg76-p2w4?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/CosmWasm/wasmvm` | Go | All versions | 1.2.5, 1.3.1, 1.4.2, 1.5.1 |
| `github.com/CosmWasm/wasmvm` | Go | All versions | 1.2.5 |
| `github.com/CosmWasm/wasmvm` | Go | All versions | 1.2.5 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.3.0 | 1.3.1 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.3.0 | 1.3.1 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.4.0 | 1.4.2 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.4.0 | 1.4.2 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.5.0 | 1.5.1 |
| `github.com/CosmWasm/wasmvm` | Go | From 1.5.0 | 1.5.1 |
| `cosmwasm-vm` | crates.io | All versions | 1.2.8 |
| `cosmwasm-vm` | crates.io | All versions | 1.2.8 |
| `cosmwasm-vm` | crates.io | From 0.0.0-0 | 1.2.8, 1.3.4, 1.4.2, 1.5.1 |
| `cosmwasm-vm` | crates.io | From 1.3.0 | 1.3.4 |
| `cosmwasm-vm` | crates.io | From 1.3.0 | 1.3.4 |
| `cosmwasm-vm` | crates.io | From 1.4.0 | 1.4.2 |
| `cosmwasm-vm` | crates.io | From 1.4.0 | 1.4.2 |
| `cosmwasm-vm` | crates.io | From 1.5.0 | 1.5.1 |
| `cosmwasm-vm` | crates.io | From 1.5.0 | 1.5.1 |

## How do I fix GHSA-75qh-gg76-p2w4?

Upgrade github.com/CosmWasm/wasmvm to a fixed version for your release line: 1.2.5, 1.3.1, 1.4.2 or 1.5.1.

## Is GHSA-75qh-gg76-p2w4 being exploited?

There is no known exploitation of GHSA-75qh-gg76-p2w4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-75qh-gg76-p2w4 and fix it if it is affected.

What it is: GHSA-75qh-gg76-p2w4 is a denial of service vulnerability in github.com/CosmWasm/wasmvm, published on 27 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-75qh-gg76-p2w4 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/CosmWasm/wasmvm (Go): affected all versions; fixed in 1.2.5, 1.3.1, 1.4.2, 1.5.1
- github.com/CosmWasm/wasmvm (Go): affected all versions; fixed in 1.2.5
- github.com/CosmWasm/wasmvm (Go): affected all versions; fixed in 1.2.5
- github.com/CosmWasm/wasmvm (Go): affected from 1.3.0; fixed in 1.3.1
- github.com/CosmWasm/wasmvm (Go): affected from 1.3.0; fixed in 1.3.1
- github.com/CosmWasm/wasmvm (Go): affected from 1.4.0; fixed in 1.4.2
- github.com/CosmWasm/wasmvm (Go): affected from 1.4.0; fixed in 1.4.2
- github.com/CosmWasm/wasmvm (Go): affected from 1.5.0; fixed in 1.5.1
- github.com/CosmWasm/wasmvm (Go): affected from 1.5.0; fixed in 1.5.1
- cosmwasm-vm (crates.io): affected all versions; fixed in 1.2.8
- cosmwasm-vm (crates.io): affected all versions; fixed in 1.2.8
- cosmwasm-vm (crates.io): affected from 0.0.0-0; fixed in 1.2.8, 1.3.4, 1.4.2, 1.5.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-75qh-gg76-p2w4/ (Markdown: https://insights.sbomify.com/GHSA-75qh-gg76-p2w4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-75qh-gg76-p2w4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-75qh-gg76-p2w4/
Summaries are generated and may contain mistakes; the official description above is the record.
