ADVISORIES

Go Vulnerability Database

GO-2022-1037

Unbounded memory consumption when reading headers in archive/tar

Details

Reader.Read does not set a limit on the maximum size of file headers. A maliciously crafted archive could cause Read to allocate unbounded amounts of memory, potentially causing resource exhaustion or panics. After fix, Reader.Read limits the maximum size of header blocks to 1 MiB.

Affected packages

EcosystemPackageAffected versions
Gostdlib
All versions before 1.18.7 (fixed in 1.18.7)
From 1.19.0-0 before 1.19.2 (fixed in 1.19.2)

References