Bug 1718388 (CVE-2019-10160)

Summary: CVE-2019-10160 python: regression of CVE-2019-9636 due to functional fix to allow port numbers in netloc
Product: [Other] Security Response Reporter: Riccardo Schirone <rschiron>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: bnater, carl, cstratak, dblechte, dfediuck, dmalcolm, eedri, extras-orphan, hhorak, jorton, kevin, m.cyprian, mgoldboi, mhroncok, michal.skrivanek, pviktori, python-maint, python-sig, rkuska, sbonazzo, shcherbina.iryna, sherold, slavek.kabrda, TicoTimo, tomspur, torsava, vstinner, yorgos.saslis, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A security regression of CVE-2019-9636 was discovered in python, since commit d537ab0ff9767ef024f26246899728f0116b1ec3, which still allows an attacker to exploit CVE-2019-9636 by abusing the user and password parts of a URL. When an application parses user-supplied URLs to store cookies, authentication credentials, or other kind of information, it is possible for an attacker to provide specially crafted URLs to make the application locate host-related information (e.g. cookies, authentication data) and send them to a different host than where it should, unlike if the URLs had been correctly parsed. The result of an attack may vary based on the application.
Story Points: ---
Clone Of:
: 1732904 (view as bug list) Environment:
Last Closed: 2019-07-12 13:07:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1718401, 1718402, 1718403, 1718405, 1718406, 1718407, 1718864, 1718865, 1718866, 1718867, 1718868, 1718869, 1718924, 1718925, 1726917, 1744471, 1744472, 1802730, 1802732, 1802733, 1802734    
Bug Blocks: 1718410    

Description Riccardo Schirone 2019-06-07 15:43:57 UTC
A security regression for CVE-2019-9636 was discovered in python's functions urllib.parse.urlsplit and urllib.parse.urlparse, introduced with commit d537ab0ff9767ef024f26246899728f0116b1ec3. No upstream python version is affected by this regression but the vulnerable commit may already have been included downstream as part of the original fix for CVE-2019-9636.

Affected python versions ignore the user/password part before `@` in the netloc component of a URL, thus it still allows an attacker to exploit the vulnerability as in CVE-2019-9636. Those functions do not properly handle URLs encoded with Punycode/Internationalizing Domain Names in Applications (IDNA), which may result in a wrong domain name (specifically the netloc component of URL - user@domain:port) being returned by those functions. When an application parses user-supplied URLs to store cookies, authentication credentials, or other kind of information, it is possible for an attacker to provide specially crafted URLs to make the application locate host-related information (e.g. cookies, authentication data) and send them to a different host than where it should, unlike if the URLs had been correctly parsed. The result of an attack may vary based on the application.

External Reference
https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html

Vulnerable commit
https://github.com/python/cpython/commit/d537ab0ff9767ef024f26246899728f0116b1ec3

Upstream patch
https://github.com/python/cpython/commit/8d0ef0b5edeae52960c7ed05ae8a12388324f87e

Comment 1 Riccardo Schirone 2019-06-07 15:44:01 UTC
Acknowledgments:

Name: Riccardo Schirone (Red Hat)

Comment 3 Riccardo Schirone 2019-06-07 16:02:45 UTC
The fix for CVE-2019-9636 caused a functional regression reported at [1], which was fixed with [2]. However, commit[2] caused the regression which this flaw is about.

[1] https://bugs.python.org/issue36742
[2] https://github.com/python/cpython/commit/d537ab0ff9767ef024f26246899728f0116b1ec3

Comment 4 Riccardo Schirone 2019-06-07 16:16:51 UTC
External References:

https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization2.html

Comment 8 Riccardo Schirone 2019-06-10 12:45:00 UTC
Created python3 tracking bugs for this issue:

Affects: fedora-all [bug 1718866]


Created python34 tracking bugs for this issue:

Affects: epel-all [bug 1718869]
Affects: fedora-all [bug 1718867]


Created python36 tracking bugs for this issue:

Affects: epel-7 [bug 1718865]

Comment 13 Eric Christensen 2019-06-13 13:25:07 UTC
Statement:

This issue did not affect the versions of python as shipped with Red Hat Enterprise Linux 5 and 6 as the security regression was not introduced in those versions. See CVE-2019-9636 for more details about the how these versions of Red Hat Enterprise Linux are affected with regard to the original flaw.

This issue did not affect the versions of python as shipped with Red Hat Enterprise Linux 8 as the security regression was not introduced in those versions. See CVE-2019-9636 for more details about the how these versions of Red Hat Enterprise Linux are affected with regard to the original flaw.

Comment 14 errata-xmlrpc 2019-06-20 20:42:38 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 16 errata-xmlrpc 2019-07-08 14:32:41 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:1700 https://access.redhat.com/errata/RHSA-2019:1700

Comment 17 Product Security DevOps Team 2019-07-12 13:07: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-10160

Comment 18 errata-xmlrpc 2019-08-12 11:54:27 UTC
This issue has been addressed in the following products:

  Red Hat Virtualization 4 for Red Hat Enterprise Linux 7

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

Comment 19 Yorgos Saslis 2019-09-25 18:11:19 UTC
*** Bug 1732904 has been marked as a duplicate of this bug. ***