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: 1856482 1856483 1856484 1856485 1856486 1856488 1856489 1856490 1856491 1856492 1856493 1856536 1856537 1856538 1856539 1856540 1856541 1856542 1856543 1856544 1856545 1856546 1856647 1856648 1856649 1856650 1856651 1856652 1882666 1885296 1916667 1916668 1916669
Blocks: 1856487
TreeView+ depends on / blocked
 
Reported: 2020-07-13 18:33 UTC by Guilherme de Almeida Suckevicz
Modified: 2023-09-25 13:11 UTC (History)
28 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in python. In Lib/tarfile.py 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.
Clone Of:
Environment:
Last Closed: 2020-10-19 20:21:20 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4273 0 None None None 2020-10-20 16:00:47 UTC
Red Hat Product Errata RHSA-2020:4285 0 None None None 2020-10-19 18:05:46 UTC
Red Hat Product Errata RHSA-2020:4299 0 None None None 2020-10-20 20:00:11 UTC
Red Hat Product Errata RHSA-2020:4433 0 None None None 2020-11-04 00:51:44 UTC
Red Hat Product Errata RHSA-2020:4641 0 None None None 2020-11-04 02:35:57 UTC
Red Hat Product Errata RHSA-2020:4654 0 None None None 2020-11-04 02:42:26 UTC
Red Hat Product Errata RHSA-2020:5009 0 None None None 2020-11-10 12:58:58 UTC
Red Hat Product Errata RHSA-2020:5010 0 None None None 2020-11-10 12:59:30 UTC
Red Hat Product Errata RHSA-2021:0528 0 None None None 2021-02-16 08:36:12 UTC
Red Hat Product Errata RHSA-2021:0761 0 None None None 2021-03-09 09:19:27 UTC
Red Hat Product Errata RHSA-2021:0881 0 None None None 2021-03-16 14:54:56 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

Comment 26 errata-xmlrpc 2020-11-04 00:51:41 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 27 errata-xmlrpc 2020-11-04 02:35:56 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 28 errata-xmlrpc 2020-11-04 02:42:24 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 31 errata-xmlrpc 2020-11-10 12:58:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 32 errata-xmlrpc 2020-11-10 12:59:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 34 errata-xmlrpc 2021-02-16 08:36:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.7 Extended Update Support

Via RHSA-2021:0528 https://access.redhat.com/errata/RHSA-2021:0528

Comment 35 errata-xmlrpc 2021-03-09 09:19:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.4 Telco Extended Update Support

Via RHSA-2021:0761 https://access.redhat.com/errata/RHSA-2021:0761

Comment 36 errata-xmlrpc 2021-03-16 14:54:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Extended Update Support

Via RHSA-2021:0881 https://access.redhat.com/errata/RHSA-2021:0881


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