Bug 1695572 (CVE-2019-9947) - CVE-2019-9947 python: CRLF injection via the path part of the url passed to urlopen()
Summary: CVE-2019-9947 python: CRLF injection via the path part of the url passed to u...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-9947
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: 1698976 1698977 1698978 1698979 1698980 1698981 1698982 1700684 1703530 1703531 1703532 1703533 1703534 1703535 1703536 1703537 1703538 1703539 1709394 1709403 1802753 1802754 1802755 1802756 1802757 1802758
Blocks: 1695712
TreeView+ depends on / blocked
 
Reported: 2019-04-03 11:41 UTC by Dhananjay Arunesh
Modified: 2021-01-20 05:23 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-10 10:53:03 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 30458 0 None None None 2019-04-10 12:40:27 UTC
Red Hat Product Errata RHSA-2019:1260 0 None None None 2019-05-22 12:01:54 UTC
Red Hat Product Errata RHSA-2019:2030 0 None None None 2019-08-06 12:04:54 UTC
Red Hat Product Errata RHSA-2019:3335 0 None None None 2019-11-05 20:38:07 UTC
Red Hat Product Errata RHSA-2019:3520 0 None None None 2019-11-05 21:06:47 UTC
Red Hat Product Errata RHSA-2019:3725 0 None None None 2019-11-06 09:45:29 UTC
Red Hat Product Errata RHSA-2020:1268 0 None None None 2020-04-01 08:34:32 UTC
Red Hat Product Errata RHSA-2020:1346 0 None None None 2020-04-07 09:33:43 UTC
Red Hat Product Errata RHSA-2020:1462 0 None None None 2020-04-14 17:39:59 UTC

Description Dhananjay Arunesh 2019-04-03 11:41:01 UTC
An issue was discovered in urllib2 in Python 2.x through 2.7.16 and urllib in
Python 3.x through 3.7.2. CRLF injection is possible if the attacker controls a
url parameter, as demonstrated by the first argument to urllib.request.urlopen
with \r\n (specifically in the path component of a URL) followed by an HTTP
header or a Redis command. This is similar to CVE-2019-9740 query string issue.

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

Comment 1 Dhananjay Arunesh 2019-04-03 12:06:22 UTC
Created python-urllib3 tracking bugs for this issue:

Affects: fedora-all [bug 1695599]

Comment 2 Dhananjay Arunesh 2019-04-03 12:06:55 UTC
Created python3-urllib3 tracking bugs for this issue:

Affects: epel-all [bug 1695600]

Comment 3 Victor Stinner 2019-04-10 12:40:28 UTC
The main Python issue became https://bugs.python.org/issue30458 which is a superseder of multiple issues. The issue is known somehow since 2011.

A first issue about HTTP Header Injection has been reported and then fixed in 2014, CVE-2016-5699 has been assigned to this issue:
https://bugs.python.org/issue22928

In 2017, a new issue has been reported because bpo-22928 https://bugs.python.org/issue22928 fix is incomplete, CVE-2019-9740 and CVE-2019-9947 have been assigned to this new issue:
https://bugs.python.org/issue30458

For more info about the history of this issue, see:
https://bugs.python.org/issue30458#msg339846

--

Vulnerable Python modules:

* urllib and/or urllib2 of Python 2
* urllib of Python 3
* urllib3

urllib3 is not part of Python standard library, it's hosted at https://github.com/urllib3/urllib3 and it is used inside the popular requests module.

The urllib3 issue is tracked at:
https://github.com/urllib3/urllib3/issues/1553

Comment 4 Dhananjay Arunesh 2019-04-11 14:24:39 UTC
Created python3 tracking bugs for this issue:

Affects: fedora-all [bug 1698976]


Created python34 tracking bugs for this issue:

Affects: fedora-all [bug 1698977]


Created python35 tracking bugs for this issue:

Affects: fedora-all [bug 1698978]

Comment 5 Dhananjay Arunesh 2019-04-11 14:25:11 UTC
Created python34 tracking bugs for this issue:

Affects: epel-all [bug 1698979]

Comment 6 Dhananjay Arunesh 2019-04-11 14:26:03 UTC
Created python36 tracking bugs for this issue:

Affects: epel-7 [bug 1698980]

Comment 7 Dhananjay Arunesh 2019-04-11 14:26:36 UTC
Created python37 tracking bugs for this issue:

Affects: fedora-28 [bug 1698981]

Comment 8 Dhananjay Arunesh 2019-04-11 14:27:08 UTC
Created python36 tracking bugs for this issue:

Affects: fedora-29 [bug 1698982]

Comment 9 Dhananjay Arunesh 2019-04-17 07:39:38 UTC
Created python3 tracking bugs for this issue:

Affects: fedora-all [bug 1700684]

Comment 10 Riccardo Schirone 2019-04-26 14:44:19 UTC
> Vulnerable Python modules:
> 
> * urllib and/or urllib2 of Python 2
> * urllib of Python 3
> * urllib3
> 
> urllib3 is not part of Python standard library, it's hosted at https://github.com/urllib3/urllib3 and it is used inside the popular requests module.
> 
> The urllib3 issue is tracked at:
> https://github.com/urllib3/urllib3/issues/1553

See CVE-2019-11236 (bug 1700824)

Comment 11 Riccardo Schirone 2019-04-26 14:45:46 UTC
With regard to the urllib module in python, there is still no fix accepted upstream.

Comment 15 Riccardo Schirone 2019-05-06 12:05:37 UTC
This flaw should be fixed by the same fix used for CVE-2019-9740.

Comment 16 errata-xmlrpc 2019-05-22 12:01:53 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.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2019:1260 https://access.redhat.com/errata/RHSA-2019:1260

Comment 17 Riccardo Schirone 2019-07-05 07:51:09 UTC
This flaw is about CLRF sequences that are not properly handled in python built-in modules urllib/urllib2 in the *path* part of the url parameter of urlopen() function.

Comment 18 Riccardo Schirone 2019-07-05 11:46:10 UTC
In reply to comment #15:
> This flaw should be fixed by the same fix used for CVE-2019-9740.

The fix for CVE-2019-9740 (https://github.com/python/cpython/pull/12755/files) does not correctly cover the case when the CRLF sequences are in the hostname part of the URL. However, when that is the case, glibc getaddrinfo() function should return an error when trying to resolve the invalid hostname, assuming glibc is not vulnerable to CVE-2016-10739. When glibc is still vulnerable to CVE-2016-10739, a proper fix in python is required to properly validate the hostname part of the URL and to prevent CRLF sequences injection.

Comment 20 Riccardo Schirone 2019-07-10 08:41:47 UTC
Reference:
https://python-security.readthedocs.io/vuln/http-header-injection2.html

Comment 21 errata-xmlrpc 2019-08-06 12:04:53 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2030 https://access.redhat.com/errata/RHSA-2019:2030

Comment 23 errata-xmlrpc 2019-11-05 20:38:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:3335 https://access.redhat.com/errata/RHSA-2019:3335

Comment 24 errata-xmlrpc 2019-11-05 21:06:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:3520 https://access.redhat.com/errata/RHSA-2019:3520

Comment 25 errata-xmlrpc 2019-11-06 09:45:25 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.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6

Via RHSA-2019:3725 https://access.redhat.com/errata/RHSA-2019:3725

Comment 27 errata-xmlrpc 2020-04-01 08:34:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

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

Comment 28 errata-xmlrpc 2020-04-07 09:33:41 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 Telco Extended Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions

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

Comment 29 errata-xmlrpc 2020-04-14 17:39:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Extended Update Support

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


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