RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2218241 - CVE-2007-4559 python-pip: Python tarfile extraction needs change to avoid a warning (mitigation) [rhel-8.9.0]
Summary: CVE-2007-4559 python-pip: Python tarfile extraction needs change to avoid a w...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: python-pip
Version: 8.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Viktorin (pviktori)
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks: CVE-2007-4559
TreeView+ depends on / blocked
 
Reported: 2023-06-28 14:13 UTC by Charalampos Stratakis
Modified: 2023-11-14 18:14 UTC (History)
5 users (show)

Fixed In Version: python-pip-9.0.3-23.el8
Doc Type: No Doc Update
Doc Text:
Clone Of: 2207997
Environment:
Last Closed: 2023-11-14 15:51:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-161100 0 None None None 2023-06-28 14:16:27 UTC
Red Hat Product Errata RHSA-2023:7176 0 None None None 2023-11-14 15:51:47 UTC

Comment 2 Charalampos Stratakis 2023-08-10 11:25:43 UTC
In order to test it:

Run this script to create a malformed tarball:

"""
import tarfile

def mkinfo(name, **kwargs):
    tarinfo = tarfile.TarInfo(name=name)
    for name, value in kwargs.items():
        setattr(tarinfo, name, value)
    return tarinfo

with tarfile.open('evil.tar.gz', 'w:gz') as tf:
    tf.addfile(mkinfo('./pyproject.toml'))
    tf.addfile(mkinfo('./tmp', type=tarfile.SYMTYPE,
                      linkname='../../../../../../../../tmp'))
    tf.addfile(mkinfo('./tmp/poc'))
"""

Do a python3 -m pip install evil.tar.gz

It will fail with: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-8lk56uxg-build/setup.py'

Whereas on the fixed pip it should reject the operation with:
"tarfile.OutsideDestinationError: 'tmp/poc' would be extracted to '/tmp/poc', which is outside the destination"

Comment 3 Charalampos Stratakis 2023-08-10 11:30:22 UTC
Verified on the PR.

Comment 8 errata-xmlrpc 2023-11-14 15:51:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: python-pip security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:7176


Note You need to log in before you can comment on or make changes to this bug.