112526 Commits

Author SHA1 Message Date
Miss Islington (bot) 72dde10164 [3.10] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling (#145816)
gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling
(cherry picked from commit 42d754e34c)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
2026-04-30 22:18:52 +01:00
Miss Islington (bot) 876858c9f6 [3.10] gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507) (#145516)
* gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507)
(cherry picked from commit a51b1b512d)

Co-authored-by: Steve Dower <steve.dower@python.org>

* Regenerate importlib_external.h

* Fix blurb entry

The `:cve:` role is not available on this branch.

---------

Co-authored-by: Steve Dower <steve.dower@python.org>
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-04-30 22:18:39 +01:00
Stan Ulbrych 47128e64f9 [3.10] gh-148395: Fix a possible UAF in {LZMA,BZ2}Decompressor (GH-148396) (#148505)
Fix dangling input pointer after `MemoryError` in _lzma/_bz2/_ZlibDecompressor.decompress

(cherry picked from commit 8fc66aef6d)
2026-04-13 22:42:24 +01:00
Stan Ulbrych c5767a7283 [3.10] gh-148169: Fix webbrowser %action substitution bypass of dash-prefix check (GH-148170) (#148521)
(cherry picked from commit d22922c8a7)
2026-04-13 22:41:53 +01:00
Hugo van Kemenade 80f0bc1834 [3.10] Default GHA permissions to contents: read (GH-148346) (#148391)
(cherry picked from commit 9c9df8ac8c)
2026-04-12 09:39:03 +03:00
Stan Ulbrych af856a7177 [3.10] gh-145986: Avoid unbound C recursion in conv_content_model in pyexpat.c (CVE 2026-4224) (GH-145987) (#146002)
* [3.10] gh-145986: Avoid unbound C recursion in `conv_content_model` in `pyexpat.c` (CVE 2026-4224) (GH-145987)

Fix C stack overflow (CVE-2026-4224) when an Expat parser
with a registered `ElementDeclHandler` parses inline DTD
containing deeply nested content model.

---------
(cherry picked from commit eb0e8be3a7)
(cherry picked from commit e5caf45faa)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Misc/NEWS.d/next/Security/2026-03-14-17-31-39.gh-issue-145986.ifSSr8.rst

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-04-08 11:27:42 +01:00
Stan Ulbrych 3d7091e69d [3.10] gh-146083: Upgrade bundled Expat to 2.7.5 (GH-146085) (#146608)
(cherry picked from commit e39d84a37d)
2026-04-08 11:27:21 +01:00
Miss Islington (bot) e70ff776fd [3.10] gh-137586: Open external osascript program with absolute path (GH-137584) (#148177)
Co-authored-by: Fionn <1897918+fionn@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-07 03:35:21 +00:00
Hugo van Kemenade 2fcd2830b7 [3.10] gh-145098: Add permissions: {} to all workflows (GH-148126) (#148139)
* [3.10] gh-145098: Use `macos-15-intel` instead of unstable `macos-26-intel` in `{jit,tail-call}.yml` (GH-148126)
(cherry picked from commit bce96a1813)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Add 'permissions: {}' to all workflows

---------

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-06 01:12:40 +03:00
Miss Islington (bot) 5782d6aa50 [3.10] gh-94632: document the subprocess need for extra_groups=() with user= (GH-148129) (#148134)
gh-94632: document the subprocess need for extra_groups=() with user= (GH-148129)
(cherry picked from commit a1cf4430ed)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-04-05 19:33:56 +01:00
Miss Islington (bot) 591ed89027 [3.10] gh-143930: Tweak the exception message and increase test coverage (GH-146476) (GH-148045) (GH-148051) (GH-148053)
(cherry picked from commit cc02351123)
(cherry picked from commit 89bfb8e5ed)
(cherry picked from commit 3681d47a44)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-04-03 22:53:24 +02:00
Hugo van Kemenade 0ee938dce0 [3.10] Remove MSI build from security-only branch (GH-148007) (GH-148008) (#148009) 2026-04-03 19:28:38 +03:00
William Woodruff ba74c01ac0 [3.10] gh-146488: hash-pin all action references (gh-146489) (#147978) 2026-04-02 11:17:37 +03:00
tomcruiseqi ad4d5ba32a [3.10] gh-143930: Reject leading dashes in webbrowser URLs (GH-143931) (GH-146359)
(cherry picked from commit 82a24a4442)

Co-authored-by: Seth Michael Larson <seth@python.org>
2026-03-24 19:23:45 +01:00
Miss Islington (bot) ba6eba5a85 [3.10] gh-145455: Show output of blurb & sphinx-build version commands (GH-145457) (#145489)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-03-05 22:29:52 +02:00
Petr Viktorin 1b49478d8a [3.10] gh-145455: Constrain setuptools to a version with pkg_resources (#145456) 2026-03-05 22:26:55 +02:00
Pablo Galindo Salgado 27c6454932 Post 3.10.20 2026-03-03 01:11:17 +00:00
Pablo Galindo Salgado 842e987df8 Python 3.10.20 v3.10.20 2026-03-03 00:49:35 +00:00
Edgar Ramírez Mondragón 003b831566 [3.10] gh-143935: Email preserve parens when folding comments (GH-143936) (#144350)
Fix 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.
(cherry picked from commit 17d1490)

Co-authored-by: Seth Michael Larson seth@python.org
Co-authored-by: Denis Ledoux dle@odoo.com

- Issue: Fix folding of long comments of unfoldable characters in email headers #143935

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
2026-03-02 23:58:52 +00:00
Stan Ulbrych 384afddc85 [3.10] gh-144363: Update bundled libexpat to 2.7.4 (GH-144365) (#144515) 2026-03-02 23:58:23 +00:00
Miss Islington (bot) c592227ffb [3.10] gh-143916: Allow HTAB in wsgiref header values (#145140)
gh-143916: Allow HTAB in wsgiref header values
(cherry picked from commit 66da7bf6fe)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-02 22:59:29 +00:00
Miss Islington (bot) 4be624a994 [3.10] gh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843) (#144862)
gh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843)

In newPySSLSocket(), when SSL_new() returns NULL, Py_DECREF(self)
was called before _setSSLError(get_state_ctx(self), ...), causing
a use-after-free. Additionally, get_state_ctx() was called with
self (PySSLSocket*) instead of sslctx (PySSLContext*), which is
a type confusion bug.

Fix by calling _setSSLError() before Py_DECREF() and using
sslctx instead of self for get_state_ctx().
(cherry picked from commit c91638ca06)

Co-authored-by: Ramin Farajpour Cami <ramin.blackhat@gmail.com>
2026-03-02 22:55:00 +00:00
Serhiy Storchaka 568342cfc8 [3.10] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (#142151)
Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.
(cherry picked from commit 694922cf40)
2026-03-02 22:54:18 +00:00
Rafael Fontenelle a191d071cf [3.10] Pin setuptools==81 to avoid pkg_resources removal (#144781) 2026-03-02 22:48:47 +00:00
Miss Islington (bot) dad6f8dff8 [3.10] gh-100538: Add workflow to verify bundled libexpat (GH-145359) (#145407)
gh-100538: Add workflow to verify bundled libexpat (GH-145359)

Add workflow to verify bundled libexpat.
(cherry picked from commit c9a5d9aae4)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-02 22:48:10 +00:00
Miss Islington (bot) e1a8a0393c [3.10] gh-144484: Warn users not to use wsgiref in production
gh-144484: Warn users not to use wsgiref in production
(cherry picked from commit 7e777c587f)

Co-authored-by: Seth Michael Larson <seth@python.org>
2026-02-05 18:46:25 +00:00
Miss Islington (bot) e3109d6267 [3.10] gh-74453: Add stronger security warning to os.path.commonprefix
gh-74453: Add stronger security warning to os.path.commonprefix (GH-144401)
(cherry picked from commit 4e15b8d95d)

Co-authored-by: Seth Michael Larson <seth@python.org>
2026-02-03 14:29:13 +00:00
Miss Islington (bot) 6027dbb199 [3.10] gh-136063: fix quadratic-complexity parsing in email.message._parseparam (GH-136072) (#140831)
gh-136063: fix quadratic-complexity parsing in `email.message._parseparam` (GH-136072)
(cherry picked from commit 680a5d070f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-25 17:11:05 +00:00
Miss Islington (bot) 5dc101675f [3.10] gh-119451: Fix a potential denial of service in http.client (GH-119454) (#142142)
gh-119451: Fix a potential denial of service in http.client (GH-119454)

Reading the whole body of the HTTP response could cause OOM if
the Content-Length value is too large even if the server does not send
a large amount of data. Now the HTTP client reads large data by chunks,
therefore the amount of consumed memory is proportional to the amount
of sent data.
(cherry picked from commit 5a4c4a033a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-25 17:10:57 +00:00
Miss Islington (bot) c97e875930 [3.10] gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146) (#142213)
* gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146)

* Remove quadratic behavior in node ID cache clearing

Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>

* Add news fragment

---------
(cherry picked from commit 08d8e18ad8)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>

* [3.14] gh-142754: Ensure that Element & Attr instances have the ownerDocument attribute (GH-142794) (#142818)

gh-142754: Ensure that Element & Attr instances have the ownerDocument attribute (GH-142794)
(cherry picked from commit 1cc7551b3f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* gh-142145: relax the no-longer-quadratic test timing (GH-143030)

* gh-142145: relax the no-longer-quadratic test timing

* require cpu resource
(cherry picked from commit 8d2d7bb2e7)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>

* merge NEWS entries into one

---------

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-01-25 17:10:49 +00:00
Miss Islington (bot) f2088a567e [3.10] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-142216) (#142299)
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-142216)

The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
therefore the memory consumption is proportional to the amount of sent
data.
(cherry picked from commit 0e4f4f1a46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-01-25 17:10:42 +00:00
Miss Islington (bot) 8cdf6204f4 [3.10] gh-144125: email: verify headers are sound in BytesGenerator (#144180)
gh-144125: email: verify headers are sound in BytesGenerator
(cherry picked from commit 052e55e7d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
Co-authored-by: Denis Ledoux <5822488+beledouxdenis@users.noreply.github.com>
Co-authored-by: Petr Viktorin <302922+encukou@users.noreply.github.com>
Co-authored-by: Bas Bloemsaat <1586868+basbloemsaat@users.noreply.github.com>
2026-01-25 17:10:00 +00:00
Seth Michael Larson 7852d72b65 [3.10] gh-143919: Reject control characters in http cookies (#144094)
(cherry picked from commit 95746b3a13)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-25 17:05:23 +00:00
Seth Michael Larson 34d76b00da [3.10] gh-143925: Reject control characters in data: URL mediatypes (#144115)
(cherry picked from commit f25509e78e)
(cherry picked from commit 2c9c746077)
2026-01-25 17:05:15 +00:00
Gregory P. Smith 2f84024955 [3.10] gh-143916: Reject control characters in wsgiref.headers.Headers
gh-143916: Reject control characters in wsgiref.headers.Headers  (GH-143917)

* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers

(cherry picked from commit f7fceed79c)
(cherry picked from commit 22e4d55285)

Co-authored-by: Seth Michael Larson <seth@python.org>
2026-01-20 22:51:43 +00:00
Hugo van Kemenade f12346d225 [3.10] Bump GitHub Actions (GH-143757) (#143803) 2026-01-13 17:23:17 +02:00
Sebastian Pipping 1173f8068b [3.10] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139532)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-25 15:25:12 +00:00
Miss Islington (bot) 9524203dee [3.10] gh-90953: Don't use deprecated AST nodes in clinic.py (GH-104322) (GH-140855)
(cherry picked from commit fe694a6db6)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-10-31 17:56:30 +01:00
Serhiy Storchaka 3a623c6c55 [3.10] gh-137836: Support more RAWTEXT and PLAINTEXT elements in HTMLParser (GH-137837) (GH-140842) (GH-140853)
(cherry picked from commit a17c57eee5)
(cherry picked from commit 0329bd11c7)
2025-10-31 17:55:58 +01:00
Łukasz Langa 892747b4cf [3.10] gh-136065: Fix quadratic complexity in os.path.expandvars() (GH-134952) (GH-140851)
(cherry picked from commit f029e8db62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 17:51:32 +01:00
Miss Islington (bot) 3eea546ed1 [3.10] gh-120384: gh-120298: Fix array-out-of-bounds & use after free list (GH-121345) (GH-140833)
(cherry picked from commit 8334a1b55c)
(cherry picked from commit 0cd888b8d3)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-10-31 15:44:28 +01:00
Adam Turner 9104fc6cdf [3.10] gh-139436: Remove `dist-pdf` from the docs archives rebuild target (GH-139437) (GH-140412)
(cherry picked from commit 0e2cdd313b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-31 14:14:36 +01:00
Pablo Galindo 014261980b Post 3.10.19 2025-10-09 18:07:32 +02:00
Pablo Galindo f08d3c437b Python 3.10.19 v3.10.19 2025-10-09 17:25:03 +02:00
Miss Islington (bot) c1e1091480 [3.10] gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (GH-139552) (GH-139761)
Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.

[1] https://github.com/torvalds/linux/commit/1b34cbbf4f011a121ef7b2d7d6e6920a036d5285
[2] https://github.com/torvalds/linux/commit/d0ca0df179c4b21e2a6c4a4fb637aa8fa14575cb.
[3] https://gitlab.com/cki-project/kernel-ark/-/commit/45bcf60fe49b37daab1acee57b27211ad1574042
(cherry picked from commit 41712c4e09)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-09 11:08:32 +02:00
Miss Islington (bot) bca11ae7d5 [3.10] gh-139700: Check consistency of the zip64 end of central directory record (GH-139702) (GH-139708) (#139714)
Support records with "zip64 extensible data" if there are no bytes
prepended to the ZIP file.

(cherry picked from commit 333d4a6f49)
(cherry picked from commit 162997bb70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 21:18:04 +02:00
Miss Islington (bot) 7317e0bbb7 [3.10] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665) (GH-137774) (GH-139660)
"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing  context depending.
Add private method HTMLParser._set_support_cdata() to change the context.
If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>".
If called with False, "<[CDATA[" starts a bogus comments which ends with ">".
(cherry picked from commit 0cbbfc4621)
(cherry picked from commit dcf24768c9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-07 14:12:23 +02:00
Sebastian Pipping 8ea678d6d1 [3.10] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) (#139613)
* gh-139400: Make sure that parent parsers outlive their subparsers in `pyexpat` (#139403)

* Modules/pyexpat.c: Disallow collection of in-use parent parsers.

Within libexpat, a parser created via `XML_ExternalEntityParserCreate`
is relying on its parent parser throughout its entire lifetime.
Prior to this fix, is was possible for the parent parser to be
garbage-collected too early.

(cherry picked from commit 6edb2ddb5f)

* Move news item to from section "Core and Builtins" to section "Security"
2025-10-07 00:34:14 +01:00
Adam Turner f610f9eab9 [3.10] Remove link to the PDF downloads (GH-139142) (#139431) 2025-09-29 21:44:38 +01:00
Miss Islington (bot) 91af026310 [3.10] gh-135374: Adjust test for setuptools' replacement of distutils (GH-138796) (GH-139303)
ensurepip installs a bundled copy of distutils, which overrides
the stdlib module. This affects several tests. This commit:

- skips distutils in test___all__, as we're unlikely to break
  `__all__` in a security-fix-only branch (and if we do it's not
  much of a a big deal)
- skips importability tests of distutils submodules if the
  setuptools hack is detected
(cherry picked from commit 987af36a71)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-09-29 16:27:23 +02:00