# CVE-2021-3121: Improper Input Validation in GoGo Protobuf

> Attackers can exploit missing index validation in GoGo Protobuf to cause memory corruption, potentially leading to code execution or denial of service.

- **Severity:** High 8.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 Jan 2021
- **Updated:** 3 Aug 2024
- **Also known as:** ALPINE-CVE-2021-3121, BIT-consul-2021-3121, BIT-protobuf-2021-3121, CLEANSTART-2025-UP04115, CLEANSTART-2026-DT87304, DEBIAN-CVE-2021-3121, GHSA-c3h9-896r-86jm, GO-2021-0053, SUSE-SU-2025:02977-1, UBUNTU-CVE-2021-3121, openSUSE-SU-2024:10902-1, openSUSE-SU-2024:10903-1, openSUSE-SU-2024:10904-1, openSUSE-SU-2024:10905-1, openSUSE-SU-2024:11553-1, openSUSE-SU-2024:11554-1

## What is CVE-2021-3121?

CVE-2021-3121 is a high-severity memory corruption vulnerability in n/a, published on 11 Jan 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

An issue was discovered in GoGo Protobuf before 1.3.2. plugin/unmarshal/unmarshal.go lacks certain index validation, aka the "skippy peanut butter" issue.

Weakness: CWE-129 (Improper Validation of Array Index)

## Which versions are affected by CVE-2021-3121?

5 open source packages ship an affected version, including github.com/gogo/protobuf, consul and protobuf. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/gogo/protobuf` | Go | All versions | 1.3.2 |
| `github.com/gogo/protobuf` | Go | All versions | 1.3.2 |
| `github.com/gogo/protobuf` | Go | All versions | 1.3.2 |
| `consul` | Bitnami | All versions | 1.8.15, 1.9.9, 1.10.2 |
| `protobuf` | Bitnami | All versions | 1.3.2 |
| `kubernetes1.18` | SUSE:Enterprise Storage 7.1 | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | openSUSE:Leap 15.6 | All versions | 1.18.20-150200.5.25.1 |
| `kubernetes1.18` | openSUSE:Tumbleweed | All versions | 1.18.20-1.2 |
| `kubernetes1.19` | openSUSE:Tumbleweed | All versions | 1.19.15-1.1 |
| `kubernetes1.20` | openSUSE:Tumbleweed | All versions | 1.20.11-1.1 |
| `kubernetes1.21` | openSUSE:Tumbleweed | All versions | 1.21.5-1.1 |
| `velero` | openSUSE:Tumbleweed | All versions | 1.7.0-1.1 |
| `velero-plugin-for-aws` | openSUSE:Tumbleweed | All versions | 1.3.0-1.1 |

Products: Golang Protobuf, Hashicorp Consul.

## How do I fix CVE-2021-3121?

Upgrade github.com/gogo/protobuf to 1.3.2 or later.

## Is CVE-2021-3121 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-3121 and fix it if it is affected.

What it is: CVE-2021-3121 is a high-severity memory corruption vulnerability in n/a, published on 11 Jan 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 CVE-2021-3121 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/gogo/protobuf (Go): affected all versions; fixed in 1.3.2
- github.com/gogo/protobuf (Go): affected all versions; fixed in 1.3.2
- github.com/gogo/protobuf (Go): affected all versions; fixed in 1.3.2
- consul (Bitnami): affected all versions; fixed in 1.8.15, 1.9.9, 1.10.2
- protobuf (Bitnami): affected all versions; fixed in 1.3.2

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

## Sources

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

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