# GHSA-773q-5334-5gf9: Memory over-allocation in evm-core

> An attacker can cause denial of service by triggering memory over-allocation in the evm-core library via specific EVM opcodes.

- **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:** 11 May 2021
- **Also known as:** RUSTSEC-2021-0066

## What is GHSA-773q-5334-5gf9?

GHSA-773q-5334-5gf9 is a denial of service vulnerability in evm-core, published on 11 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Prior to the patch, when executing specific EVM opcodes related
to memory operations that use `evm_core::Memory::copy_large`, the
crate can over-allocate memory when it is not needed, making it
possible for an attacker to perform denial-of-service attack.

The flaw was corrected in commit `19ade85`.

## Which versions are affected by GHSA-773q-5334-5gf9?

11 open source packages ship an affected version, including evm-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `evm-core` | crates.io | All versions | 0.21.1 |
| `evm-core` | crates.io | All versions | 0.21.1 |
| `evm-core` | crates.io | From 0.0.0-0 | 0.21.1, 0.23.1, 0.24.1, 0.25.1, 0.26.1 |
| `evm-core` | crates.io | From 0.23.0 | 0.23.1 |
| `evm-core` | crates.io | From 0.23.0 | 0.23.1 |
| `evm-core` | crates.io | From 0.24.0 | 0.24.1 |
| `evm-core` | crates.io | From 0.24.0 | 0.24.1 |
| `evm-core` | crates.io | From 0.25.0 | 0.25.1 |
| `evm-core` | crates.io | From 0.25.0 | 0.25.1 |
| `evm-core` | crates.io | From 0.26.0 | 0.26.1 |
| `evm-core` | crates.io | From 0.26.0 | 0.26.1 |

## How do I fix GHSA-773q-5334-5gf9?

Upgrade evm-core to a fixed version for your release line: 0.21.1, 0.23.1, 0.24.1 or 0.25.1.

## Is GHSA-773q-5334-5gf9 being exploited?

There is no known exploitation of GHSA-773q-5334-5gf9 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-773q-5334-5gf9 and fix it if it is affected.

What it is: GHSA-773q-5334-5gf9 is a denial of service vulnerability in evm-core, published on 11 May 2021. 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-773q-5334-5gf9 in the wild and no public exploit code.

Affected packages and fixed versions:
- evm-core (crates.io): affected all versions; fixed in 0.21.1
- evm-core (crates.io): affected all versions; fixed in 0.21.1
- evm-core (crates.io): affected from 0.0.0-0; fixed in 0.21.1, 0.23.1, 0.24.1, 0.25.1, 0.26.1
- evm-core (crates.io): affected from 0.23.0; fixed in 0.23.1
- evm-core (crates.io): affected from 0.23.0; fixed in 0.23.1
- evm-core (crates.io): affected from 0.24.0; fixed in 0.24.1
- evm-core (crates.io): affected from 0.24.0; fixed in 0.24.1
- evm-core (crates.io): affected from 0.25.0; fixed in 0.25.1
- evm-core (crates.io): affected from 0.25.0; fixed in 0.25.1
- evm-core (crates.io): affected from 0.26.0; fixed in 0.26.1
- evm-core (crates.io): affected from 0.26.0; fixed in 0.26.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-773q-5334-5gf9/ (Markdown: https://insights.sbomify.com/GHSA-773q-5334-5gf9/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-773q-5334-5gf9

---
From sbomify Insights: https://insights.sbomify.com/GHSA-773q-5334-5gf9/
Summaries are generated and may contain mistakes; the official description above is the record.
