CVE-2025-58183: Unbounded Allocation Vulnerability in Go's Archive/Tar Package

stdlib Updated 04 Nov 2025

Summary

29/10/2025
Yes i
Unrated
Not published

CVE-2025-58183: Unbounded allocation when parsing GNU sparse map in archive/tar. Affects stdlib across 2 version ranges.

< 1.24.8 >= 1.25.0, < 1.25.2

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

Also tracked for

The same CVE-2025-58183 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 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 Go programming language's standard library includes the archive/tar package, which provides functionality for reading and writing tar archives. This package is widely used for handling tar files, including those that utilize the GNU sparse format. The package's ability to manage sparse files is essential for efficient storage, but it also introduces potential security risks if not properly managed.

Vulnerability Detail

The vulnerability arises from the tar.Reader's failure to impose a maximum limit on the number of sparse region data blocks when parsing GNU tar pax 1.0 sparse files. An attacker can exploit this by crafting a malicious archive that contains an excessive number of sparse regions, leading the Reader to read an unbounded amount of data into memory. This can result in significant memory allocation, potentially causing denial of service or application crashes, especially when dealing with compressed sources where small inputs can decompress into large allocations.

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.24.8 1.24.8
    go get stdlib@v1.24.8
  • >= 1.25.0, < 1.25.2 1.25.2
    go get stdlib@v1.25.2

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

Workaround

As a temporary workaround, avoid processing untrusted or unverified tar archives, especially those that may contain sparse regions. Additionally, consider implementing checks on the size of the data being read to prevent excessive memory usage.

Conclusion

CVE-2025-58183 highlights a significant vulnerability in the Go standard library's archive/tar package, which can lead to unbounded memory allocation. It is crucial for developers to update their Go installations to the latest patched versions and to exercise caution when handling tar archives.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

CVE-2025-58183 is a vulnerability in the Go standard library's archive/tar package that allows for unbounded memory allocation when parsing certain types of tar files.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your Gopkg.lock file without needing to sign up.

The primary risk is denial of service due to excessive memory allocation, which can lead to application crashes or degraded performance.

You can update your Go version by using the command 'go get golang.org/dl/go1.25.2' and then downloading it with 'go1.25.2 download'.

Yes, you can mitigate the risk by avoiding the processing of untrusted tar files and implementing size checks on data being read.

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.24.8 1.24.8
    go get stdlib@v1.24.8
  • >= 1.25.0, < 1.25.2 1.25.2
    go get stdlib@v1.25.2

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