The latest tagged release. There are no long-lived release branches, so a fix ships in the next tag rather than being backported.
Use GitHub's private vulnerability reporting on this repository (Security → Report a vulnerability). It stays private until a fix ships.
Please do not open a public issue for a suspected vulnerability first.
This package reads untrusted archives. A report is a crafted input that escapes one of these:
- An entry that writes outside the
*os.Rootpassed toExtract, whether through a traversal name, a symlink, a hardlink, or a case collision on a case-insensitive filesystem. - A crafted header that makes a decoder allocate far beyond the 256 MiB decoder window cap, including a dictionary or window size declared in the archive itself.
- A crafted archive that makes a reader panic rather than return an error.
RecoverMalformedturns such a panic intoErrMalformedfor a deferred call, but a reachable panic is still a bug. - A
Listerthat decompresses pastListerOptions.MaxEntryBytes, or reports a size that differs from the bytes it yields. - A zip whose end record declares more entries than the cap (
MaxEntries, orListerOptions.MaxEntries), or a directory larger than 1 KiB times that cap, that is parsed instead of refused up front. - A ratio or size cap that a crafted archive can satisfy while extracting more than the cap allows.
Format detection is by magic bytes, so a file whose extension disagrees with its contents is read as what its bytes say. That is intended, and not an issue.
Archives the caller has already validated and chosen to trust. This package bounds resource use; it does not decide what a caller should do with a file it extracted.