#VU18827 Exposed dangerous method or function in Python - CVE-2019-9948


| Updated: 2020-07-20

Vulnerability identifier: #VU18827

Vulnerability risk: Medium

CVSSv4.0: 6.9 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P/U:Green]

CVE-ID: CVE-2019-9948

CWE-ID: CWE-749

Exploitation vector: Network

Exploit availability: No

Vulnerable software:
Python
Universal components / Libraries / Scripting languages

Vendor: Python.org

Description

The vulnerability allows a remote attacker to bypass certain security restrictions.

The vulnerability exists due to urllib implementation in Python 2.x supports the local_file: scheme. An attacker with ability to control input data, such as URL, can bypass protection mechanisms that blacklist file: URIs and view contents of arbitrary file on the system.

PoC:

urllib.urlopen('local_file:///etc/passwd')

Mitigation
Install update from vendor's website.

Vulnerable software versions

Python: 2.7.0 - 2.7.2150, 3.5.0 - 3.5.7, 3.6.0 - 3.6.8, 3.7.0 - 3.7.3


External links
https://bugs.python.org/issue35907
https://github.com/python/cpython/pull/11842
https://github.com/python/cpython/commit/4fe82a8eef7aed60de05bfca0f2c322730ea921e
https://github.com/python/cpython/commit/4f06dae5d8d4400ba38d8502da620f07d4a5696e
https://github.com/python/cpython/commit/34bab215596671d0dec2066ae7d7450cd73f638b


Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability. However, proof of concept for this vulnerability is available.


Latest bulletins with this vulnerability