Bug 1718388 (CVE-2019-10160) - CVE-2019-10160 python: regression of CVE-2019-9636 due to functional fix to allow port numbers in netloc
Summary: CVE-2019-10160 python: regression of CVE-2019-9636 due to functional fix to a...
Status: NEW
Alias: CVE-2019-10160
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=important,public=20190603,repo...
Keywords: Security
Depends On: 1718402 1718403 1718405 1718864 1718865 1718866 1718867 1718868 1718869 1718924 1718925 1718401 1718406 1718407
Blocks: 1718410
TreeView+ depends on / blocked
 
Reported: 2019-06-07 15:43 UTC by Riccardo Schirone
Modified: 2019-06-20 20:42 UTC (History)
28 users (show)

(edit)
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.
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1587 None None None 2019-06-20 20:42 UTC

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


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