zlib Buffer Overflow Vulnerability in untgz Utility

Vulnerability

A global buffer overflow vulnerability has been identified in zlib versions through 1.3.1.2, specifically within the untgz utility. The issue arises in the TGZfname() function, where an attacker can supply an archive name that is copied into a fixed-size 1024-byte static global buffer. This is done using an unbounded strcpy() call, without any length validation. As a result, an archive name longer than 1024 bytes can cause an out-of-bounds write, leading to memory corruption. This vulnerability can cause a denial-of-service, memory corruption of adjacent global objects, undefined behavior, and potentially code execution, depending on the compiler, architecture, build flags, and memory layout.

Impact

Exploitation of this vulnerability causes a global buffer overflow, which can lead to memory corruption, a program crash, and potentially arbitrary code execution.

Reproduction

The vulnerability can be reproduced by invoking the untgz utility with an excessively long filename argument, exceeding 1024 bytes. This can be done using a command that generates a string of 'A' characters, for example, 4096 'A's, and passes it as an argument to untgz. The AddressSanitizer (ASAN) will report the global buffer overflow error, indicating that the vulnerability has been successfully exploited.

Added: Jan 7, 2026, 9:22 PM
Updated: Jan 7, 2026, 9:22 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
10.0
exploitability
6.0
remediation
0.0
relevance
1.9
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.