PSF-2019-12: Critical severity Python Software Foundation urllib vulnerability
urllib in Python 2.x through 2.7.16 supports the localfile: scheme, which makes it easier for remote attackers to bypass protection mechanisms that blacklist file: URIs, as demonstrated by triggering a urllib.urlopen('localfile:///etc/passwd') call.
Affected Software
Event History
Frequently Asked Questions
What condition must exist for an attacker to exploit this issue?
The attacker must be able to cause application code to call urllib.urlopen() with an attacker-controlled URL or otherwise influence the URL scheme. Exploitation relies on a protection mechanism that blocks file: URIs but does not also block the local_file: scheme.
Which systems are affected?
The affected component is urllib in Python 2.x through Python 2.7.16. The issue is relevant to applications using those versions that rely on file: URI blacklisting as a defense against local-file access.
How can teams identify potentially exposed code?
Review Python 2.x code for urllib.urlopen() calls that receive untrusted or externally controlled URLs. Pay particular attention to filters that reject file: URLs without rejecting local_file: URLs.