REDHAT-BUG-2494158: Medium severity GNU gzip vulnerability
GNU gzip contains a vulnerability in the gzexe utility related to insecure temporary file handling. When the mktemp utility is not available in the user’s PATH, gzexe falls back to constructing a temporary file path based solely on the process ID (PID). This predictable filename is created without exclusive access or existence checks. A local attacker can pre‑create the predicted temporary file path as a symbolic link pointing to an arbitrary file writable by the victim. When gzexe runs, it follows the symlink and overwrites the target file, resulting in a time‑of‑check to time‑of‑use (TOCTOU) condition that allows arbitrary file overwrite.
This issue has been fixed in the commit 4e6f8b24ab823146ab8776f0b7fe486ab34d4269
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
GNU gzip (gzexe utility)to a version that resolves this vulnerability.Patch 4e6f8b24ab823146ab8776f0b7fe486ab34d4269
Event History
Frequently Asked Questions
When is the vulnerable temporary-file fallback used?
The fallback is used when the mktemp utility is not available in the PATH of the user running gzexe.
What access does an attacker need to exploit this issue?
An attacker needs local access and must be able to pre-create the predictable temporary-file path as a symbolic link. The symlink target must be a file writable by the gzexe user.
What can be overwritten if exploitation succeeds?
The attacker can cause gzexe to overwrite an arbitrary file that is writable by the victim running gzexe, by redirecting the predictable temporary path through a symbolic link.
What can be done before a patch is applied?
Ensure that mktemp is available in the PATH used to run gzexe, preventing the described PID-based fallback from being selected.
How can the fix be identified without relying on a version number?
The issue is fixed by commit 4e6f8b24ab823146ab8776f0b7fe486ab34d4269. Check whether the deployed GNU gzip package includes that fix.