Python vulnerabilities
54 known CVE vulnerabilities in Python, translated and rated.
- CVE-2013-7338High
Python versions before 3.3.4 RC1 allow remote attackers to cause a denial of service via a file size value larger than the size of the zip file in functions related to reading and extracting zip files.
- CVE-2022-42919High
A vulnerability in Python 3.9.x before 3.9.16 and 3.10.x before 3.10.9 on Linux allows local privilege escalation in a non-default configuration. The multiprocessing library with the forkserver start method permits pickle deserialization from any user on the same local network of the machine.
- CVE-2023-27043Medium
The email module in Python through 3.11.3 incorrectly parses email addresses containing special characters. The wrong portion of an RFC2822 header is identified as the value of the addr-spec.
- CVE-2026-1299Medium
The email module in Python, specifically the BytesGenerator class, improperly quotes newlines in email headers during serialization, allowing header injection. This only affects usage of LiteralHeader that does not respect email folding.
- CVE-2023-24329High
A vulnerability in the urllib.parse component of Python before version 3.11.4 allows attackers to bypass blocklisting methods by supplying a URL that starts with blank characters.
- CVE-2020-10735High
A flaw was found in Python. In algorithms with quadratic time complexity using non-binary bases, when using int("text"), a system could take 50ms to parse an int string with 100,000 digits and 5s for 1,000,000 digits (float, decimal, int.from_bytes(), and int() for binary bases 2, 4, 8, 16, and 32 are not affected). The highest threat from this vulnerability is to system availability.
- CVE-2021-3737High
A flaw in Python's HTTP client code, when improperly handling an HTTP response, may cause the client script to enter an infinite loop, consuming CPU time. The highest threat is to system availability.
- CVE-2022-0391High
A flaw in Python's urllib.parse module, where the urlparse method does not sanitize input and allows characters like '\r' and '\n' in the URL path, enabling an attacker to craft a URL that leads to injection attacks. Affected versions are earlier than 3.10.0b1, 3.9.5, 3.8.11, 3.7.11, and 3.6.14.
- CVE-2021-29921Critical
In Python before 3.9.5, the ipaddress library mishandles leading zero characters in the octets of an IP address string. This (in some situations) allows attackers to bypass access control that is based on IP addresses.
- CVE-2021-23336Medium
The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9.0 and before 3.9.2 are vulnerable to Web Cache Poisoning via urllib.parse.parse_qsl and urllib.parse.parse_qs by using a vector called parameter cloaking. When the attacker can separate query parameters using a semicolon (;), they can cause a difference in the interpretation of the request between the proxy (running with default configuration) and the server.
- CVE-2021-3177Critical
Python 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 Python applications that accept floating-point numbers as untrusted input, as demonstrated by a 1e300 argument to c_double.from_param. This occurs because sprintf is used unsafely.
- CVE-2020-27619Critical
In Python 3 through 3.9.0, the Lib/test/multibytecodec_support.py CJK codec tests call eval() on content retrieved via HTTP. This may lead to arbitrary code execution if the content is crafted.
- CVE-2020-26116High
http.client in Python 3.x before 3.5.10, 3.6.x before 3.6.12, 3.7.x before 3.7.9, and 3.8.x before 3.8.5 allows CRLF injection if the attacker controls the HTTP request method, e.g., by inserting CR and LF control characters in the first argument of HTTPConnection.request.
- CVE-2020-15801Critical
In Python 3.8.4, sys.path restrictions specified in a python38._pth file are ignored, allowing code to be loaded from arbitrary locations. The <executable-name>._pth file (e.g., the python._pth file) is not affected.
- CVE-2020-14422Medium
Lib/ipaddress.py in Python through 3.8.3 improperly computes hash values in the IPv4Interface and IPv6Interface classes, which might allow a remote attacker to cause a denial of service if an application is affected by the performance of a dictionary containing these objects. Fixed in multiple Python versions.
- CVE-2019-9674High
Lib/zipfile.py in Python through 3.7.2 allows remote attackers to cause a denial of service (resource consumption) via a ZIP bomb. A maliciously crafted ZIP file can lead to excessive memory or CPU usage.
- CVE-2020-8492Medium
Python 2.7 through 2.7.17, 3.5 through 3.5.9, 3.6 through 3.6.10, 3.7 through 3.7.6, and 3.8 through 3.8.1 allows an HTTP server to conduct Regular Expression Denial of Service (ReDoS) attacks against a client because of urllib.request.AbstractBasicAuthHandler catastrophic backtracking.
- CVE-2019-5010High
Vulnerability in the X509 certificate parser of Python 2.7.11 and 3.6.6 allows denial of service via a specially crafted X509 certificate causing a NULL pointer dereference.
- CVE-2019-16056High
An issue was discovered in Python through 2.7.16, 3.x through 3.5.7, 3.6.x through 3.6.9, and 3.7.x through 3.7.4. The email module wrongly parses email addresses that contain multiple @ characters. An application that uses the email module and implements some kind of checks on the From/To headers of a message could be tricked into accepting an email address that should be denied. An attack may be the same as in CVE-2019-11340; however, this CVE applies to Python more generally.
- CVE-2019-10160Critical
A security regression of CVE-2019-9636 was discovered in Python since commit d537ab0ff9767ef024f26246899728f0116b1ec3 affecting versions 2.7, 3.5, 3.6, 3.7 and from v3.8.0a4 through v3.8.0b1. An attacker can still 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 information, it is possible for an attacker to provide specially crafted URLs to make the application send host-related information to a different host than intended.
- CVE-2019-9948Critical
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.
- CVE-2019-9636Critical
Python 2.7.x through 2.7.16 and 3.x through 3.7.2 is affected by improper handling of Unicode encoding (with an incorrect netloc) during NFKC normalization. The impact is information disclosure (credentials, cookies, etc. cached against a given hostname). The components are urllib.parse.urlsplit and urllib.parse.urlparse. A specially crafted URL could be incorrectly parsed to locate cookies or authentication data and send that information to a different host.
- CVE-2018-20406High
A vulnerability in Modules/_pickle.c in Python before 3.7.1 involves an integer overflow via a large LONG_BINPUT value mishandled during a resize-to-twice-the-size attempt. It may cause memory exhaustion, but only when the pickle format is used to serialize tens or hundreds of gigabytes of data.
- CVE-2018-14647High
Python's elementtree C accelerator failed to initialize Expat's hash salt during initialization. This could make it easy to conduct denial of service attacks against Expat by constructing an XML document that causes pathological hash collisions in Expat's internal data structures, consuming large amounts of CPU and RAM. The vulnerability exists in Python versions 3.7.0, 3.6.0 through 3.6.6, 3.5.0 through 3.5.6, 3.4.0 through 3.4.9, 2.7.0 through 2.7.15.
- CVE-2018-1000802Critical
Python (CPython) version 2.7 contains a command injection vulnerability (CWE-77) in the shutil module (make_archive function) that can result in denial of service, information gain, or injection of arbitrary files on the system or entire drive. The attack is exploitable via passing unfiltered user input to the function.
- CVE-2018-1061Medium
Python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in the difflib.IS_LINE_JUNK method. An attacker could use this flaw to cause denial of service.
- CVE-2018-1060High
Python before versions 2.7.15, 3.4.9, 3.5.6rc1, 3.6.5rc1 and 3.7.0 is vulnerable to catastrophic backtracking in pop3lib's apop() method. An attacker could use this flaw to cause denial of service.
- CVE-2026-116566Medium
The socket.getaddrinfo() function accepted null bytes within the *host* and *port* parameters, which could cause the values to be silently truncated. This may lead to unintended name resolution or connections to a different address than intended.
- CVE-2026-85864High
Improper privilege management in Python allows an authorized attacker to elevate privileges locally.
- CVE-2026-15310Low
When decompressing crafted zip files using the bzip/LZMA/Zstandard compressions, Python could use an attacker-controlled size to pre-allocate memory, possibly resulting in memory exhaustion.
- CVE-2026-17084Medium
The 'stringprep' module did not process characters from RFC 3454 tables B.2 or B.3 correctly: the latest Unicode codepoint attributes were used instead of the specified Unicode 3.2.0. This causes mismatches when processing domain names using IDNA 2003 (the 'idna' codec) and the in_table_b2() function of the 'stringprep' module. This only affects domain names containing characters that were not previously registered or had their Unicode attributes such as case-folding behavior updated since Unicode 3.2.0.
- CVE-2026-18503Low
A vulnerability in Python's csv.Sniffer where attacker-controlled CSV samples can trigger super-linear regular-expression work during dialect sniffing, consuming significant CPU.
- CVE-2026-15308High
The incremental HTML parser (html.parser.HTMLParser) allows CPU denial-of-service through repeated unterminated markup declarations when processing uncontrolled data.
- CVE-2026-12003Medium
CVE-2026-12003 vulnerability concerns how Python handles the VPATH variable during builds from the source tree. On Windows, VPATH may point to a location outside the Python installation directory, potentially allowing low-privilege users to create files that could be used to access an alternative `Lib` folder.
- CVE-2026-9669High
bz2.BZ2Decompressor objects could be reused after a decompression error. If an application caught the resulting OSError and retried with the same decompressor, crafted input could cause the decompressor to resume from an invalid internal state and perform out-of-bounds writes to a stack buffer. This could crash the process when processing untrusted data.
- CVE-2026-7774Medium
The tarfile.data_filter function in Python can be bypassed using crafted symlinks, allowing files to be written outside the target directory during tar extraction. An attacker can place files in arbitrary locations.
- CVE-2026-3276Medium
The unicodedata.normalize() function can consume excessive CPU time when processing specially crafted Unicode input containing long runs of combining characters with alternating Canonical Combining Class values. This affects all normalization forms.
- CVE-2026-8328Medium
Vulnerability in the ftpcp() function in Python's ftplib.py module. This function was not updated when CVE-2021-4189 was fixed, allowing an attacker to control the IP address and port passed to target.sendport().
- CVE-2026-3298High
The sock_recvfrom_into() method in asyncio.ProactorEventLoop (Windows only) lacked a boundary check for the data buffer when using the nbytes parameter, allowing an out-of-bounds buffer write if data was larger than the buffer size.
- CVE-2026-6100High
A use-after-free vulnerability was found in Python's standard library in `lzma.LZMADecompressor`, `bz2.BZ2Decompressor`, and `gzip.GzipFile`. It occurs when a memory allocation fails with a `MemoryError` and the decompressor instance is reused. The fix cleans up the dangling pointer in this specific error condition.
- CVE-2026-4519Low
The webbrowser.open() API in Python would accept URLs starting with dashes, which could be interpreted as command line options by certain web browsers. The new behavior rejects such URLs.
- CVE-2025-0938Medium
The Python standard library functions `urllib.parse.urlsplit` and `urlparse` accept domain names with square brackets, which is invalid per RFC 3986. Square brackets are only meant as delimiters for IPv6 and IPvFuture hosts. This can cause differential parsing between Python's URL parser and other compliant parsers.
- CVE-2023-40217Medium
An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5, affecting servers using TLS client authentication. If a TLS server-side socket is closed quickly, data may still be readable from the socket buffer without authentication.
- CVE-2022-48564Medium
read_ints in plistlib.py in Python through 3.9.1 is vulnerable to a potential DoS attack via CPU and RAM exhaustion when processing malformed Apple Property List files in binary format.
- CVE-2022-48560High
A use-after-free exists in Python through 3.9 via heappushpop in heapq. It can lead to memory corruption during heap operations.
- CVE-2022-45061High
An issue was discovered in Python before 3.11.1. An unnecessary quadratic algorithm exists in one path when processing some inputs to the IDNA (RFC 3490) decoder, such that a crafted, unreasonably long name being presented to the decoder could lead to a CPU denial of service.
- CVE-2021-4189Medium
A flaw was found in Python, specifically in the FTP (File Transfer Protocol) client library in PASV (passive) mode. The issue is how the FTP client trusts the host from the PASV response by default. This flaw allows an attacker to set up a malicious FTP server that can trick FTP clients into connecting back to a given IP address and port. This vulnerability could lead to FTP client scanning ports, which otherwise would not have been possible.
- CVE-2021-28861High
Python 3.x through 3.10 has an open redirection vulnerability in lib/http/server.py due to no protection against multiple (/) at the beginning of URI path, which may lead to information disclosure. NOTE: this is disputed by a third party because the http.server.html documentation page states "Warning: http.server is not recommended for production. It only implements basic security checks."
- CVE-2022-26488High
In Python before 3.10.3 on Windows, local users can gain privileges because the search path is inadequately secured. The installer may allow a local attacker to add user-writable directories to the system search path. To exploit, an administrator must have installed Python for all users and enabled PATH entries. A non-administrative user can trigger a repair that incorrectly adds user-writable paths into PATH, enabling search-path hijacking of other users and system services. This affects Python (CPython) through 3.7.12, 3.8.x through 3.8.12, 3.9.x through 3.9.10, and 3.10.x through 3.10.2.
- CVE-2021-3426Medium
There's a flaw in Python 3's pydoc. A local or adjacent attacker who discovers or is able to convince another local or adjacent user to start a pydoc server could access the server and use it to disclose sensitive information belonging to the other user that they would not normally be able to access. The highest risk of this flaw is to data confidentiality. This flaw affects Python versions before 3.8.9, Python versions before 3.9.3 and Python versions before 3.10.0a7.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

