Back

HIGH

tar: does not properly warn the user when extracting setuid or setgid files

Published Aug 10, 2005

Description

Tar 1.15.1 does not properly warn the user when extracting setuid or setgid files, which may allow local users or remote attackers to gain privileges.

Affected products

Remediation

Red Hat statement

Currently, there are no plans to change tar behaviour to strip setuid and setgid bits when extracting archives. This vulnerability is considered moderate rather than important because the exploitation scenario requires specific conditions: the `tar` extraction must be performed by the root user, and the tarball itself must be crafted maliciously with setuid or setgid bits. In typical use cases, users do not routinely extract untrusted tar files as root, reducing the likelihood of exploitation. Additionally, non-root extractions do not preserve these bits unless explicitly requested with the `-p` option.

Red Hat mitigation

To mitigate the risks associated with this vulnerability, avoid extracting tar files as the root user, especially when dealing with untrusted sources. Instead, perform extractions as a non-root user or in a restricted environment. Use a dedicated, empty directory for extracting archives to prevent accidental exposure of sensitive files. After extraction, review the file permissions to check for unexpected setuid or setgid bits before granting access. When extraction as root is necessary, use the --no-same-permissions option to prevent preserving the setuid and setgid bits.

Metrics

Weaknesses (0)

No CWE recorded.

References (6)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner mitre
Published Aug 10, 2005
Updated Aug 7, 2024
Reserved Aug 10, 2005
NVD
Status Modified
Modified Jun 16, 2026
Red Hat
Severity Moderate
Public date Aug 4, 2005