CVE-2022-30635: stdlib - Stack Exhaustion in Decoder.Decode

golang-1.15 Updated 02 Oct 2025

Summary

10/08/2022
N/A
No i
High
7.5

CVE-2022-30635: Uncontrolled recursion in Decoder.Decode in encoding/gob before Go 1.17.12 and Go 1.18.4 allows an attacker to cause a panic due to stack exhaustion via a message which contains deeply nested structures. Affects golang-1.15 versions < 1ed3c127daceaffb9aadc806ba60f0b51b47421b. No fix is published. How to fix ↓

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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The stdlib package is a standard library in the Go programming language. It provides a collection of packages that offer fundamental functionality for Go programs. The package is widely used and forms the backbone of many Go applications. However, it is susceptible to a vulnerability that allows an attacker to cause a panic due to stack exhaustion in the Decoder.Decode function of the encoding/gob package.

Vulnerability Detail

Uncontrolled recursion in the Decoder.Decode function of encoding/gob before Go versions 1.17.12 and 1.18.4 can be exploited by an attacker. By sending a message containing deeply nested structures, the attacker can trigger a panic due to stack exhaustion. This vulnerability poses a high risk as it can lead to denial of service (DoS) attacks and potentially allow an attacker to execute arbitrary code.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update the stdlib package to the fixed versions mentioned above to mitigate the risk.

Conclusion

The stdlib package in Go is vulnerable to a stack exhaustion vulnerability in the Decoder.Decode function. This can lead to denial of service (DoS) attacks and potential code execution. It is crucial for developers to update their stdlib package to versions 1.17.12 or 1.18.4 to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for golang-1.15 →

Share this vulnerability

FAQ

This vulnerability can lead to denial of service (DoS) attacks and potentially allow an attacker to execute arbitrary code.

The vulnerability affects versions of the stdlib package before 1.17.12 and 1.18.4.

No, there is no known workaround. Updating to the fixed versions is the recommended solution.

There are no known public exploits for this vulnerability at the time of writing.

You can find more information about this vulnerability in the National Vulnerability Database (NVD) entry: https://nvd.nist.gov/vuln/detail/CVE-2022-30635.

Related vulnerabilities

Recent vulnerabilities recorded for golang-1.15.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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