CVE-2022-30631: Vulnerability in stdlib package - stack exhaustion in Reader.Read

golang-1.15 Updated 02 Oct 2025

Summary

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

CVE-2022-30631: Uncontrolled recursion in Reader.Read in compress/gzip before Go 1.17.12 and Go 1.18.4 allows an attacker to cause a panic due to stack exhaustion via an archive containing a large number of concatenated 0-length compres... 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 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 stdlib package is a part of the Go programming language standard library. It provides a collection of packages that offer essential functionality for Go programs. The package in question, compress/gzip, is responsible for reading and writing gzip-compressed files. It is widely used for data compression and decompression in various applications.

Vulnerability Detail

The vulnerability, identified as CVE-2022-30631, exists in the Reader.Read function of the compress/gzip package before versions 1.17.12 and 1.18.4. It arises due to uncontrolled recursion, which can be triggered by an attacker through an archive containing a large number of concatenated 0-length compressed files. This can lead to a panic and stack exhaustion, potentially causing a denial-of-service (DoS) condition. The severity of this vulnerability is rated as HIGH with a CVSS score of 7.5.

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

As a workaround, developers can consider implementing input validation to prevent the processing of malicious archives with a large number of concatenated 0-length compressed files. However, applying the official fix by updating the stdlib package is the recommended approach.

Conclusion

The vulnerability in the stdlib package's compress/gzip module can be mitigated by updating to versions 1.17.12 or 1.18.4. Developers should prioritize applying the official fix to prevent potential denial-of-service (DoS) conditions. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for golang-1.15 →

Share this vulnerability

FAQ

The vulnerability can be exploited to cause a panic and stack exhaustion, potentially leading to a denial-of-service (DoS) condition in applications utilizing the compress/gzip package.

Versions before 1.17.12 and 1.18.4 of the compress/gzip package are vulnerable to this issue.

At the time of this report, there is no known public exploit available for this vulnerability.

Updating the stdlib package to versions 1.17.12 or 1.18.4 is the recommended mitigation. Additionally, implementing input validation can help mitigate the risk of processing malicious archives.

There is no evidence of active exploitation of this vulnerability at the time of this report.

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