urllib in Python 2.x through 2.7.16 supports the local_file: scheme, which makes it easier for remote attackers to bypass protection mechani
urllib in Python 2.x through 2.7.16 supports the local_file: scheme, which makes it easier for remote attackers to bypass protection mechanisms that blacklist file: URIs, as demonstrated by triggering a urllib.urlopen('local_file:///etc/passwd') call.
- Published
- Mar 23, 2019
- Updated
- Jun 16, 2026
- EPSS
- 11.8% · 96th percentile
- CWE
- CWE-22
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
40
Plan
Add it to your regular patch cycle.
- CVSS
- 36 / 40 · 9.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 4 / 30 · 11.8%
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| python | python | cpe:2.3:a:python:python |
| opensuse | leap | cpe:2.3:o:opensuse:leap |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
| canonical | ubuntu linux | cpe:2.3:o:canonical:ubuntu_linux |
| redhat | enterprise linux desktop | cpe:2.3:o:redhat:enterprise_linux_desktop |
| redhat | enterprise linux eus | cpe:2.3:o:redhat:enterprise_linux_eus |
| redhat | enterprise linux server | cpe:2.3:o:redhat:enterprise_linux_server |
| redhat | enterprise linux server eus | cpe:2.3:o:redhat:enterprise_linux_server_eus |
| redhat | enterprise linux tus | cpe:2.3:o:redhat:enterprise_linux_tus |
| redhat | enterprise linux workstation | cpe:2.3:o:redhat:enterprise_linux_workstation |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- canonical ubuntu linux12.04
- canonical ubuntu linux14.04
- canonical ubuntu linux16.04
- canonical ubuntu linux18.04
- canonical ubuntu linux19.04
- debian debian linux8.0
- debian debian linux9.0
- fedoraproject fedora29
- fedoraproject fedora30
- opensuse leap15.0
- opensuse leap42.3
- python python2.0 and later · before 2.7.17
- python python3.5.0 and later · before 3.5.8
- python python3.6.0 and later · before 3.6.9
- python python3.7.0 and later · before 3.7.4
- redhat enterprise linux desktop7.0
- redhat enterprise linux desktop8.0
- redhat enterprise linux eus8.1
- redhat enterprise linux eus8.2
- redhat enterprise linux eus8.4
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | python-psycopg2-doc | before 2.7.5-7.module_el8.6.0+2781+fed64c13 | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-attrs | before 17.4.0-10.module_el8.6.0+2781+fed64c13 | 17.4.0-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-chardet | before 3.0.4-10.module_el8.6.0+2781+fed64c13 | 3.0.4-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-coverage | before 4.5.1-4.module_el8.6.0+2781+fed64c13 | 4.5.1-4.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-Cython | before 0.28.1-7.module_el8.6.0+2781+fed64c13 | 0.28.1-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-dns | before 1.15.0-10.module_el8.6.0+2781+fed64c13 | 1.15.0-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docs | before 2.7.16-2.module_el8.6.0+2781+fed64c13 | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docs-info | before 2.7.16-2.module_el8.6.0+2781+fed64c13 | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docutils | before 0.14-12.module_el8.6.0+2781+fed64c13 | 0.14-12.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-funcsigs | before 1.0.2-13.module_el8.6.0+2781+fed64c13 | 1.0.2-13.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-idna | before 2.5-7.module_el8.6.0+2781+fed64c13 | 2.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-ipaddress | before 1.0.18-6.module_el8.6.0+2781+fed64c13 | 1.0.18-6.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-markupsafe | before 0.23-19.module_el8.6.0+2781+fed64c13 | 0.23-19.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-mock | before 2.0.0-13.module_el8.6.0+2781+fed64c13 | 2.0.0-13.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-pluggy | before 0.6.0-8.module_el8.6.0+2781+fed64c13 | 0.6.0-8.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-psycopg2 | before 2.7.5-7.module_el8.6.0+2781+fed64c13 | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-psycopg2-debug | before 2.7.5-7.module_el8.6.0+2781+fed64c13 | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-psycopg2-tests | before 2.7.5-7.module_el8.6.0+2781+fed64c13 | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-py | before 1.5.3-6.module_el8.6.0+2781+fed64c13 | 1.5.3-6.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-PyMySQL | before 0.8.0-10.module_el8.6.0+2781+fed64c13 | 0.8.0-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-pysocks | before 1.6.8-6.module_el8.6.0+2781+fed64c13 | 1.6.8-6.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-pytest | before 3.4.2-13.module_el8.6.0+2781+fed64c13 | 3.4.2-13.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-pytest-mock | before 1.9.0-4.module_el8.6.0+2781+fed64c13 | 1.9.0-4.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-pytz | before 2017.2-12.module_el8.6.0+2781+fed64c13 | 2017.2-12.module_el8.6.0+2781+fed64c13 |
+96
Same product
python: all recordsOther highest-scoring records for the same primary product.
- CVE-2016-5636Integer overflow in the get_data function in zipimport.c in CPython (aka Python) before 2.7.12, 3.x before 3.4.5, and 3.5.x before 3.5.2 all47Plan
- CVE-2007-4559Directory traversal vulnerability in the (1) extract and (2) extractall functions in the tarfile module in Python allows user-assisted remot47Plan
- CVE-2021-3177Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution in certain Pyth46Plan
- CVE-2014-4650The CGIHTTPServer module in Python 2.7.5 and 3.3.4 does not properly handle URLs in which URL encoding is used for path separators, which al46Plan
- CVE-2018-1000802Python Software Foundation Python (CPython) version 2.7 contains a CWE-77: Improper Neutralization of Special Elements used in a Command ('C45Plan
- CVE-2020-27619In Python 3 through 3.9.0, the Lib/test/multibytecodec_support.py CJK codec tests call eval() on content retrieved via HTTP.42Plan
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| almalinux:python-psycopg2-doc | 2.7.5-7.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-attrs | 17.4.0-10.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-chardet | 3.0.4-10.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-coverage | 4.5.1-4.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-Cython | 0.28.1-7.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-dns | 1.15.0-10.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-docs | 2.7.16-2.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-docs-info | 2.7.16-2.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-docutils | 0.14-12.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-funcsigs | 1.0.2-13.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-idna | 2.5-7.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python2-PyMySQL | 0.8.0-10.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| alpine:python2 | 2.7.16-r1 · Alpine:v3.10 | Package registry (OSV) |
| debian:python2.7 | 2.7.16-2 · Debian:11 | Package registry (OSV) |
| debian:python3.4 | 3.4.2-1+deb8u5 · Debian:8 | Package registry (OSV) |
| debian:python3.5 | 3.5.3-1+deb9u2 · Debian:9 | Package registry (OSV) |
| opensuse:python | 2.7.14-lp150.6.10.1 · openSUSE:Leap 15.0 | Package registry (OSV) |
| red hat:python | 0:2.7.5-86.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:python-debug | 0:2.7.5-86.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:python-debuginfo | 0:2.7.5-86.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:python-libs | 0:2.7.5-86.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:python27-python | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-debug | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-debuginfo | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-devel | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-libs | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-test | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-python-tools | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| red hat:python27-tkinter | 0:2.7.16-6.el6 · Red Hat:rhel_software_collections:3::el6 | Package registry (OSV) |
| rocky linux:babel | 0:2.5.1-9.module+el8.4.0+403+9ae17a31 · Rocky Linux:8 | Package registry (OSV) |
+14
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- None
Weakness class (CWE)
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
nvd-primary
Root cause
A user-supplied file name is joined with the allowed directory, but the result is never checked to confirm it is still inside that directory.
The bug in code
The whole CWE-22 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const file = path.join(ROOT, req.query.name);res.sendFile(file);Fixed
const file = path.resolve(ROOT, req.query.name);if (!file.startsWith(ROOT + path.sep)) { return res.sendStatus(400);}res.sendFile(file);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Path TraversalCAPEC-126likelihood: High · Very High
- Using Slashes and URL Encoding Combined to Bypass Validation LogicCAPEC-64likelihood: High · High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
- Using Escaped Slashes in Alternate EncodingCAPEC-78likelihood: High · High
- Using Slashes in Alternate EncodingCAPEC-79likelihood: High · High
ATT&CK techniques
—
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- lists.opensuse.org/opensuse-security-announce/2019-04/msg00092.html
- lists.opensuse.org/opensuse-security-announce/2019-06/msg00050.html
- packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html
- www.securityfocus.com/bid/107549
- access.redhat.com/errata/RHSA-2019:1700
- access.redhat.com/errata/RHSA-2019:2030
- access.redhat.com/errata/RHSA-2019:3335
- access.redhat.com/errata/RHSA-2019:3520
- github.com/python/cpython/pull/11842
- lists.apache.org/thread.html/r1b103833cb5bc8466e24ff0ecc5e75b45a705334ab6a444e64e840a0%40%3Cissues.bookkeeper.apache.org%3E
- lists.debian.org/debian-lts-announce/2019/06/msg00022.html
- lists.debian.org/debian-lts-announce/2019/07/msg00011.html
- lists.debian.org/debian-lts-announce/2020/07/msg00011.html
- lists.debian.org/debian-lts-announce/2020/08/msg00034.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HQEQLXLOCR3SNM3AA5RRYJFQ5AZBYJ4L/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KRYFIMISZ47NTAU3XWZUOFB7CYL62KES/
- seclists.org/bugtraq/2019/Oct/29
- security.gentoo.org/glsa/202003-26
- security.netapp.com/advisory/ntap-20190404-0004/
- usn.ubuntu.com/4127-1/
Vendor advisories and official records. Exploit/PoC links are deliberately left out.