# CVE-2020-5303: Denial of service in Tendermint

> An attacker can cause a denial of service in Tendermint by exhausting memory through uncontrolled P2P connection requests and activeID leaks.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Apr 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-v24h-pjjv-mcp6

## What is CVE-2020-5303?

CVE-2020-5303 is a low-severity denial of service vulnerability in Tendermint, published on 10 Apr 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Tendermint before versions 0.33.3, 0.32.10, and 0.31.12 has a denial-of-service vulnerability. Tendermint does not limit the number of P2P connection requests. For each p2p connection, it allocates XXX bytes. Even though this memory is garbage collected once the connection is terminated (due to duplicate IP or reaching a maximum number of inbound peers), temporary memory spikes can lead to OOM (Out-Of-Memory) exceptions. Additionally, Tendermint does not reclaim activeID of a peer after it's removed in Mempool reactor. This does not happen all the time. It only happens when a connection fails (for any reason) before the Peer is created and added to all reactors. RemovePeer is therefore called before AddPeer, which leads to always growing memory (activeIDs map). The activeIDs map has a maximum size of 65535 and the node will panic if this map reaches the maximum. An attacker can create a lot of connection attempts (exploiting above denial of service), which ultimately will lead to the node panicking. These issues are patched in Tendermint 0.33.3 and 0.32.10.

Weakness: CWE-787 (Out-of-bounds Write), CWE-789 (Memory Allocation with Excessive Size Value)

## Which versions are affected by CVE-2020-5303?

6 open source packages ship an affected version, including github.com/tendermint/tendermint. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/tendermint/tendermint` | Go | All versions | 0.31.12 |
| `github.com/tendermint/tendermint` | Go | All versions | 0.31.12 |
| `github.com/tendermint/tendermint` | Go | From 0.32.0 | 0.32.10 |
| `github.com/tendermint/tendermint` | Go | From 0.32.0 | 0.32.10 |
| `github.com/tendermint/tendermint` | Go | From 0.33.0 | 0.33.3 |
| `github.com/tendermint/tendermint` | Go | From 0.33.0 | 0.33.3 |

Products: Tendermint Tendermint.

## How do I fix CVE-2020-5303?

Upgrade github.com/tendermint/tendermint to a fixed version for your release line: 0.31.12, 0.32.10 or 0.33.3.

## Is CVE-2020-5303 being exploited?

There is no known exploitation of CVE-2020-5303 in the wild and no public exploit code.

## Other vulnerabilities in Tendermint

- [CVE-2019-25072](https://insights.sbomify.com/CVE-2019-25072/): Uncontrolled resource consumption in github.com/tendermint/tendermint (high 7.5)
- [CVE-2021-21271](https://insights.sbomify.com/CVE-2021-21271/): Denial of service in TenderMint Core (medium 6.5)
- [CVE-2020-15091](https://insights.sbomify.com/CVE-2020-15091/): Denial of Service in TenderMint (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-5303 and fix it if it is affected.

What it is: CVE-2020-5303 is a low-severity denial of service vulnerability in Tendermint, published on 10 Apr 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2020-5303 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/tendermint/tendermint (Go): affected all versions; fixed in 0.31.12
- github.com/tendermint/tendermint (Go): affected all versions; fixed in 0.31.12
- github.com/tendermint/tendermint (Go): affected from 0.32.0; fixed in 0.32.10
- github.com/tendermint/tendermint (Go): affected from 0.32.0; fixed in 0.32.10
- github.com/tendermint/tendermint (Go): affected from 0.33.0; fixed in 0.33.3
- github.com/tendermint/tendermint (Go): affected from 0.33.0; fixed in 0.33.3

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/CVE-2020-5303/ (Markdown: https://insights.sbomify.com/CVE-2020-5303/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-5303
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-5303
- OSV: https://osv.dev/vulnerability/CVE-2020-5303

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-5303/
Summaries are generated and may contain mistakes; the official description above is the record.
