CVE-2021-3121: Panic due to improper input validation in github.com/gogo/protobuf

github.com/gogo/protobuf Updated 02 Oct 2025

Summary

14/04/2021
Yes i
High
8.6

CVE-2021-3121: Panic due to improper input validation in github.com/gogo/protobuf. Affects github.com/gogo/protobuf versions < 1.3.2. Fixed in 1.3.2. How to fix ↓

Also tracked for

The same CVE-2021-3121 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package github.com/gogo/protobuf is a Go implementation of the Protocol Buffers data serialization format. It provides tools for generating Go code from .proto files and supports various features such as custom options, extensions, and more. This package is widely used in Go projects for efficient and reliable data serialization. However, a vulnerability has been discovered in the package that can lead to a panic due to improper input validation.

Vulnerability Detail

The vulnerability (CVE-2021-3121) arises from improper bounds checking in the generated Unmarshal methods of github.com/gogo/protobuf. Maliciously crafted input can trigger an out-of-bounds panic. This vulnerability can be exploited by attackers to launch a denial of service attack, particularly when parsing messages from untrusted sources. The impact of this vulnerability can result in the disruption of service availability and potential system crashes.

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

go get github.com/gogo/protobuf@v1.3.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of the package as soon as possible.

Conclusion

In conclusion, the vulnerability (CVE-2021-3121) in github.com/gogo/protobuf can lead to out-of-bounds panics when parsing malicious input. This can be used as a denial of service vector, impacting service availability and potentially causing system crashes. It is highly recommended to update to version 1.3.2 or later to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/gogo/protobuf →

Share this vulnerability

FAQ

github.com/gogo/protobuf is a Go package that provides an implementation of the Protocol Buffers data serialization format. It offers tools for generating Go code from .proto files and supports various features for efficient data serialization.

The vulnerability can be exploited by attackers to cause a denial of service by triggering out-of-bounds panics. This can lead to service disruptions and potential system crashes.

To fix this vulnerability, update the package to version 1.3.2 or later. Rebuild your application with the patched version of github.com/gogo/protobuf.

No, there is no known workaround for this vulnerability. It is crucial to update to the fixed version of the package.

Yes, this vulnerability can be exploited remotely by sending maliciously crafted input to the affected Unmarshal methods.

References

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

go get github.com/gogo/protobuf@v1.3.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback