Python 3.12.13
Release date: March 3, 2026
Security content in this release
- gh-144125:
BytesGeneratorwill now refuse to serialize (write) headers that are unsafely folded or delimited; seeverify_generated_headers. (Contributed by Bas Bloemsaat and Petr Viktorin in gh-121650). - gh-143935: Fixed a bug in the folding of comments when flattening an email message using a modern email policy. Comments consisting of a very long sequence of non-foldable characters could trigger a forced line wrap that omitted the required leading space on the continuation line, causing the remainder of the comment to be interpreted as a new header field. This enabled header injection with carefully crafted inputs.
- gh-143925: Reject control characters in data: URL media types.
- gh-143919: Reject control characters in
http.cookies.Morselfields and values. - gh-143916: Reject C0 control characters within wsgiref.headers.Headers fields, values, and parameters.
- gh-142145: Remove quadratic behavior in
xml.minidomnode ID cache clearing. In order to do this without breaking existing users, we also add the ownerDocument attribute toxml.dom.minidomelements and attributes created by directly instantiating theElementorAttrclass. Note that this way of creating nodes is not supported; creator functions likexml.dom.Document.documentElement()should be used instead. - gh-137836: Add support of the “plaintext” element, RAWTEXT elements “xmp”, “iframe”, “noembed” and “noframes”, and optionally RAWTEXT element “noscript” in
html.parser.HTMLParser. - gh-136063:
email.message: ensure linear complexity for legacy HTTP parameters parsing. Patch by Bénédikt Tran. - gh-136065: Fix quadratic complexity in
os.path.expandvars(). - gh-119451: Fix a potential memory denial of service in the
http.clientmodule. When connecting to a malicious server, it could cause an arbitrary amount of memory to be allocated. This could have led to symptoms including aMemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes. - gh-119452: Fix a potential memory denial of service in the
http.servermodule. When a malicious user is connected to the CGI server on Windows, it could cause an arbitrary amount of memory to be allocated. This could have led to symptoms including aMemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes. - gh-119342: Fix a potential memory denial of service in the
plistlibmodule. When reading a Plist file received from untrusted source, it could cause an arbitrary amount of memory to be allocated. This could have led to symptoms including aMemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes.
Files
| Version | Description | File Size |
|---|---|---|
| Windows installer (64-bit) | Recommended | 25.6 MB |
| Windows installer (32-bit) | 24.4 MB | |
| Windows installer (ARM64) | Experimental | 24.9 MB |