Bug 1856481 (CVE-2019-20907) - CVE-2019-20907 python: infinite loop in the tarfile module via crafted TAR archive
Summary: CVE-2019-20907 python: infinite loop in the tarfile module via crafted TAR ar...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-20907
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1856536 1856537 1856539 1856540 1856541 1856542 1856546 1856648 1856649 1856650 1856652 1856482 1856483 1856484 1856485 1856486 1856488 1856489 1856490 1856491 1856492 1856493 1856538 1856543 1856544 1856545 1856647 1856651 1882666 1885296
Blocks: 1856487
TreeView+ depends on / blocked
 
Reported: 2020-07-13 18:33 UTC by Guilherme de Almeida Suckevicz
Modified: 2020-10-20 20:00 UTC (History)
26 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-19 20:21:20 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4273 None None None 2020-10-20 16:00:47 UTC
Red Hat Product Errata RHSA-2020:4285 None None None 2020-10-19 18:05:46 UTC
Red Hat Product Errata RHSA-2020:4299 None None None 2020-10-20 20:00:11 UTC

Description Guilherme de Almeida Suckevicz 2020-07-13 18:33:53 UTC
In Lib/tarfile.py in Python through 3.8.3, an attacker is able to craft a TAR archive leading to an infinite loop when opened by tarfile.open, because _proc_pax lacks header validation.

Reference:
https://bugs.python.org/issue39017

Upstream commit:
https://github.com/python/cpython/pull/21454

Comment 1 Guilherme de Almeida Suckevicz 2020-07-13 18:35:14 UTC
Created mingw-python3 tracking bugs for this issue:

Affects: fedora-all [bug 1856489]


Created python2 tracking bugs for this issue:

Affects: fedora-all [bug 1856485]


Created python26 tracking bugs for this issue:

Affects: fedora-all [bug 1856486]


Created python3 tracking bugs for this issue:

Affects: fedora-all [bug 1856488]


Created python34 tracking bugs for this issue:

Affects: epel-all [bug 1856483]
Affects: fedora-all [bug 1856491]


Created python35 tracking bugs for this issue:

Affects: fedora-all [bug 1856490]


Created python36 tracking bugs for this issue:

Affects: fedora-all [bug 1856492]


Created python37 tracking bugs for this issue:

Affects: fedora-all [bug 1856493]


Created python38 tracking bugs for this issue:

Affects: fedora-all [bug 1856484]


Created python39 tracking bugs for this issue:

Affects: fedora-all [bug 1856482]

Comment 3 Todd Cullum 2020-07-13 21:42:41 UTC
Mitigation:

This flaw can be mitigated by not opening untrusted files with tarfile.

Comment 6 Todd Cullum 2020-07-13 21:48:04 UTC
Statement:

A service is vulnerable if it uses python's tarfile module to open untrusted tar files. If an attacker is able to submit a crafted tar file to a service which uses the tarfile module to open it, an infinite loop will be executed, potentially causing a denial of service. The tarfile module is included with python.

Comment 7 Todd Cullum 2020-07-13 22:00:35 UTC
Flaw summary:

In Lib/tarfile.py's _proc_pax() function, there's a while True loop which relies upon the value of the pos variable in order to exit the loop. This variable is incremented with `pos += length` but it's possible for length to be 0, thus the loop will never exit. It's possible for length to be set to 0 because the function uses regex to parse the length like: (length, keyword, value). The patch raises an exception if the length variable is 0 and adds a test.

Comment 10 Miro Hrončok 2020-07-16 11:51:26 UTC
Tomas, Joshua, is the updated summary of all the bugzillas scripted? Can the script be updated to use the *This is a minor update (do not send email)* option?

Comment 20 errata-xmlrpc 2020-10-19 18:05:43 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2020:4285 https://access.redhat.com/errata/RHSA-2020:4285

Comment 21 Product Security DevOps Team 2020-10-19 20:21:20 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-20907

Comment 22 errata-xmlrpc 2020-10-20 16:00:44 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2020:4273 https://access.redhat.com/errata/RHSA-2020:4273

Comment 25 errata-xmlrpc 2020-10-20 20:00:08 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2020:4299 https://access.redhat.com/errata/RHSA-2020:4299


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