REDHAT-BUG-263261: Medium severity Python TarFile vulnerability
Common Vulnerabilities and Exposures assigned an identifier CVE-2007-4559 to the following vulnerability:
Directory traversal vulnerability in the (1) extract and (2) extractall functions in the tarfile module in Python allows user-assisted remote attackers to overwrite arbitrary files via a .. (dot dot) sequence in filenames in a TAR archive, a related issue to CVE-2001-1267.
References:
Issue and additional attack vectors were discussed in following thread on python-dev mailinglist:
http://mail.python.org/pipermail/python-dev/2007-August/074290.html
Upstream bug tracking possible fixes for the issue:
http://bugs.python.org/issue1044
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Do not call tarfile.extract or tarfile.extractall on TAR archives from untrusted or unauthenticated sources. Before extracting, validate and sanitize each member name to reject any paths containing '..' or absolute paths and ensure constructed target paths remain inside the intended destination directory.
Python tarfile module use of extract/extractall = disabled for untrusted archives - Compensating control
Perform TAR extraction only in a restricted environment (unprivileged account, chroot, container, or sandbox) and restrict filesystem permissions for the extraction target to limit the impact of any path traversal overwrite.
- Operational
Audit systems and recent extraction operations for unexpected file modifications or overwrites that could indicate exploitation via crafted TAR archives; restore affected files from trusted backups if needed.
- Operational
Monitor the upstream bug tracker (bugs.python.org issue1044) and the referenced CVE (CVE-2007-4559) for available fixes or vendor patches and apply appropriate updates when they are released.
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-263261?
The severity of REDHAT-BUG-263261 is considered high due to the potential for remote code execution.
How do I fix REDHAT-BUG-263261?
To fix REDHAT-BUG-263261, ensure you update your Python tarfile module to the latest version that addresses this vulnerability.
What causes REDHAT-BUG-263261?
REDHAT-BUG-263261 is caused by a directory traversal vulnerability in the 'extract' and 'extractall' functions of the Python tarfile module.
Which versions of Python are affected by REDHAT-BUG-263261?
Specific versions of the Python tarfile module are affected, and you should check the security advisories for a complete list of vulnerable versions.
Is REDHAT-BUG-263261 related to CVE-2007-4559?
Yes, REDHAT-BUG-263261 is associated with CVE-2007-4559, which identifies the same directory traversal vulnerability.