#VU18827 Exposed dangerous method or function in Python


Published: 2019-06-19 | Updated: 2020-07-20

Vulnerability identifier: #VU18827

Vulnerability risk: Medium

CVSSv3.1: 6.1 [CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N/E:P/RL:O/RC:C]

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
http://bugs.python.org/issue35907
http://github.com/python/cpython/pull/11842
http://github.com/python/cpython/commit/4fe82a8eef7aed60de05bfca0f2c322730ea921e
http://github.com/python/cpython/commit/4f06dae5d8d4400ba38d8502da620f07d4a5696e
http://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