CVE-2021-39293: Panic due to crafted inputs in archive/zip

stdlib Updated 02 Oct 2025

Summary

18/05/2022
Yes i
Unrated
Not published

CVE-2021-39293: Panic due to crafted inputs in archive/zip. Affects stdlib across 2 version ranges.

< 1.16.8 >= 1.17.0-0, < 1.17.1

Fixed in 1.16.8 or 1.17.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-39293 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

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 in Go provides a collection of standard libraries for various functionalities. One of these libraries is archive/zip, which allows for the creation and extraction of ZIP archives. It includes functions like NewReader and OpenReader, which are used to read ZIP archives. However, a vulnerability has been discovered in these functions that can lead to a panic or an unrecoverable fatal error when processing a specially crafted ZIP archive. This vulnerability was introduced in versions 0 and 1.17.0-0 of the stdlib package and was partially fixed in versions 1.16.8 and 1.17.1.

Vulnerability Detail

The vulnerability in archive/zip arises from an incomplete fix for CVE-2021-33196. When reading a ZIP archive that claims to contain a large number of files, regardless of its actual size, the NewReader and OpenReader functions can trigger a panic or an unrecoverable fatal error. This can be exploited by an attacker to cause a denial-of-service condition or potentially execute arbitrary code. The issue stems from improper handling of the number of files in the ZIP archive, leading to a panic when the number exceeds certain limits.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.16.8 1.16.8
    go get stdlib@v1.16.8
  • >= 1.17.0-0, < 1.17.1 1.17.1
    go get stdlib@v1.17.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround provided for this vulnerability. The recommended approach is to update the stdlib package to the fixed versions.

Conclusion

The vulnerability in archive/zip can lead to a panic or an unrecoverable fatal error when processing a specially crafted ZIP archive. It is crucial to update the stdlib package to versions 1.16.8 or 1.17.1 to mitigate this vulnerability. Regularly updating dependencies is also recommended to stay up-to-date with security patches and bug fixes. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

archive/zip is a standard library package in Go that provides functionality for creating and extracting ZIP archives.

The NewReader and OpenReader functions in the archive/zip package are affected by this vulnerability.

Exploiting this vulnerability can lead to a panic or an unrecoverable fatal error, potentially causing a denial-of-service condition or enabling arbitrary code execution.

Versions 0 and 1.17.0-0 of the stdlib package are affected by this vulnerability.

No specific workarounds are provided. Updating to the fixed versions of the stdlib package is recommended.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.16.8 1.16.8
    go get stdlib@v1.16.8
  • >= 1.17.0-0, < 1.17.1 1.17.1
    go get stdlib@v1.17.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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