Commit graph

109595 commits

Author SHA1 Message Date
Miss Islington (bot)
fc2c98f92f
[3.9] gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210) (GH-116068)
Use of a proxy is intended to defer DNS for the hosts to the proxy itself, rather than a potential for information leak of the host doing DNS resolution itself for any reason.  Proxy bypass lists are strictly name based.  Most implementations of proxy support agree.
(cherry picked from commit c43b26d02e)

Co-authored-by: Weii Wang <weii.wang@canonical.com>
2024-03-19 11:53:42 +01:00
Sebastian Pipping
200762426b
[3.9] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116272)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:

- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`

Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .

Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-07 00:03:30 +01:00
Miss Islington (bot)
468ba95c79
[3.9] gh-107077: Raise SSLCertVerificationError even if the error is set via SSL_ERROR_SYSCALL (GH-107586) (#107590)
(cherry picked from commit 77e09192b5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-21 17:02:34 +01:00
Seth Michael Larson
4b68e5d7ab
[3.9] Upgrade bundled libexpat to 2.6.0 (GH-115399) (GH-115474)
Manual backport due to code differences.
(cherry picked from commit e071b0d558)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-02-21 13:48:13 +01:00
Miss Islington (bot)
0397866920
[3.9] gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400) (GH-115763)
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-02-21 12:45:14 +01:00
Seth Michael Larson
dafb4f0c6b
[3.9] Fix tests for XMLPullParser with Expat 2.6.0 (GH-115133) (GH-115535)
Feeding the parser by too small chunks defers parsing to prevent
CVE-2023-52425. Future versions of Expat may be more reactive.
(cherry picked from commit 4a08e7b343)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-21 12:22:55 +01:00
Miss Islington (bot)
c23f74903f
[3.9] gh-97032: avoid test_squeezer crash on macOS buildbots (GH-115508) (#115655)
(cherry picked from commit 17a6533dbf)

Co-authored-by: Ned Deily <nad@python.org>
2024-02-21 12:17:44 +01:00
Hugo van Kemenade
3fcea416f8
[3.9] gh-115349: Pin theme to fix code snippets (GH-115351)
Pin theme to fix code snippets
2024-02-13 13:56:59 +01:00
Miss Islington (bot)
fa1f564118
[3.9] Add missing sections to blurbs (GH-114553) (GH-115339)
(cherry picked from commit dc8893af7d)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-13 13:56:31 +01:00
Łukasz Langa
24c6514765
[3.9] gh-111239: Update Windows build to use zlib 1.3.1 (GH-114877) (GH-115087)
(cherry picked from commit 618d7256e7)

Co-authored-by: Zachary Ware <zach@python.org>
2024-02-06 16:08:31 +01:00
Serhiy Storchaka
8fc8c45b67
[3.9] gh-113659: Skip hidden .pth files (GH-113660) (GH-114146)
(cherry picked from commit 74208ed0c4)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-01-17 15:28:17 +01:00
Miss Islington (bot)
dd068eaf48
[3.9] gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 (GH-109928) (GH-114184)
(cherry picked from commit 9dbfe2dc8e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-01-17 15:10:35 +01:00
Adam Turner
2613df8ee2
[3.9] gh-114021: Pin various sphinxcontrib extensions to older versions (GH-114022) (GH-114039)
(cherry picked from commit 94b1d1fa38)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2024-01-17 14:48:31 +01:00
Miss Islington (bot)
a2c59992e9
[3.9] gh-109858: Protect zipfile from "quoted-overlap" zipbomb (GH-110016) (GH-113915)
Raise BadZipFile when try to read an entry that overlaps with other entry or
central directory.
(cherry picked from commit 66363b9a7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-17 14:48:06 +01:00
Serhiy Storchaka
d54e22a669
[3.9] gh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930) (GH-112842)
(cherry picked from commit 81c16cd94e)

Co-authored-by: Søren Løvborg <sorenl@unity3d.com>
2024-01-17 14:47:47 +01:00
Miss Islington (bot)
a6f73f6114
[3.9] bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503) (GH-112600)
* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.
(cherry picked from commit 0daf555c6f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2024-01-17 14:47:26 +01:00
Zachary Ware
75da5067cf
[3.9] gh-109991: Update Windows build to use OpenSSL 1.1.1w (GH-111265)
(cherry picked from commit dcb16c98be)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-01-17 14:47:09 +01:00
Ned Deily
f4118e9995
[3.9] gh-109991: Update GitHub CI workflows to use OpenSSL 3.0.11 and multissltests to use 1.1.1w and 3.0.11. (GH-110008)
(cherry picked from commit c88037d137)
2024-01-17 14:46:46 +01:00
Maciej Olko
f86e20e4a8
[3.9] Fix documentation build by pinning Alabaster version to 0.7.13 (#113815)
Alabaster is Sphinx's dependency. Alabaster 0.7.14 released on 2024-01-08 dropped support for Sphinx 3.3 and earlier.

https://alabaster.readthedocs.io/en/latest/changelog.html
2024-01-10 10:35:38 +01:00
Seth Michael Larson
300d3155af
[3.9] gh-112160: Add 'regen-configure' make target (#112164)
Add 'regen-configure' make target
2023-12-07 00:26:24 +01:00
Łukasz Langa
08b640e157
[3.9] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695) (gh-111780)
(cherry picked from commit c8faa3568a)

Co-authored-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
2023-11-06 18:44:50 +01:00
Miss Islington (bot)
43a6e4fa49
[3.9] gh-109002: Ensure only one wheel for each vendored package (GH-109003) (#109008)
Output with one wheel:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
Verifying checksum for /Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl.
Expected digest: 7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
Actual digest:   7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
::notice file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Successfully verified the checksum of the pip wheel.
```

Output with two wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-22.0.4-py3-none-any.whl::Found more than one wheel for package pip.

::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Found more than one wheel for package pip.
```

Output without wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=::Could not find a pip wheel on disk.
```
(cherry picked from commit f8a047941f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-09-06 20:01:05 +02:00
Hugo van Kemenade
13905c93b6
[3.9] CI: Bump GitHub Actions (GH-108879) (#108893)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-09-05 22:39:06 +02:00
Miss Islington (bot)
e4b971c338
[3.9] [3.10] Add a dummy .rtfd.yml file to silence invalid failing webhooks (GH-108908) (#108925)
(cherry picked from commit 5970435b26)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-05 17:37:59 +02:00
Łukasz Langa
cf69231a70
Post 3.9.18 2023-08-24 21:18:58 +02:00
Łukasz Langa
376d66eb50
Python 3.9.18 2023-08-24 19:59:28 +02:00
Łukasz Langa
92f9ce726b
Fix invalid string escape 2023-08-24 19:44:27 +02:00
Łukasz Langa
d2cd0a3acb
[3.9] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) (#108407)
* In preauth tests of test_ssl, explicitly break reference cycles
  invoving SingleConnectionTestServerThread to make sure that the
  thread is deleted. Otherwise, the test marks the environment as
  altered because the threading module sees a "dangling thread"
  (SingleConnectionTestServerThread). This test leak was introduced
  by the test added for the fix of issue gh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
  timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
  test_preauth_data_to_tls_client(): the server now waits until the
  client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
  explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb6fc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-24 12:09:11 +02:00
Miss Islington (bot)
b8058b3da5
[3.9] gh-108342: Break ref cycle in SSLSocket._create() exc (GH-108344) (#108351)
Explicitly break a reference cycle when SSLSocket._create() raises an
exception. Clear the variable storing the exception, since the
exception traceback contains the variables and so creates a reference
cycle.

This test leak was introduced by the test added for the fix of GH-108310.
(cherry picked from commit 64f9935035)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-23 12:10:49 +02:00
Ned Deily
d31ae21e5d
[3.9] gh-107565: Update multissltests and GitHub CI workflows to use OpenSSL 1.1.1v, 3.0.10, and 3.1.2. (#108123)
[3.9] gh-107565: Update multissltests and GitHub CI workflows to use  OpenSSL 1.1.1v, 3.0.10, and 3.1.2.

(cherry picked from commit 441797d4ff)
2023-08-22 20:28:57 +02:00
Petr Viktorin
42deeab5b2
[3.9] gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846) (#108274)
(cherry picked from commit acbd3f9c5c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
2023-08-22 20:28:10 +02:00
Serhiy Storchaka
4a79328195
[3.9] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613) (GH-107224) (#107231)
Previously *consumed was not set in this case.
(cherry picked from commit f08e52ccb0).
(cherry picked from commit b8b3e6afc0)
2023-08-22 20:25:15 +02:00
Łukasz Langa
264b1dacc6
[3.9] gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw (#108320)
gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw

Instances of `ssl.SSLSocket` were vulnerable to a bypass of the TLS handshake
and included protections (like certificate verification) and treating sent
unencrypted data as if it were post-handshake TLS encrypted data.

The vulnerability is caused when a socket is connected, data is sent by the
malicious peer and stored in a buffer, and then the malicious peer closes the
socket within a small timing window before the other peers’ TLS handshake can
begin. After this sequence of events the closed socket will not immediately
attempt a TLS handshake due to not being connected but will also allow the
buffered data to be read as if a successful TLS handshake had occurred.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-08-22 19:57:10 +02:00
Erlend E. Aasland
38b489bae8
[3.9] CI: Bump macOS build to use OpenSSL v3.0 (GH-105538) (#105871)
(cherry picked from commit 34e93d3998)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-05 13:20:44 +02:00
Miss Islington (bot)
ce93371488
[3.9] [3.11] Add single value agen.athrow(value) signature to the 3.11 docs gh-105269 (GH-105468) (#105477)
(cherry picked from commit acf3916e84)

Co-authored-by: Federico Caselli <CaselIT@users.noreply.github.com>
2023-07-05 13:18:49 +02:00
Łukasz Langa
1528b420b3
Post 3.9.17 2023-06-06 14:17:01 +02:00
Łukasz Langa
0d3cd4eb66
Python 3.9.17 2023-06-06 11:32:53 +02:00
Miss Islington (bot)
e1c396d164
[3.9] gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (#105221)
(cherry picked from commit ee26ca13a1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-05 17:42:16 +02:00
Gregory P. Smith
e15de14c16
[3.9] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (GH-105200) (#105205)
Upgrade builds to OpenSSL 1.1.1u.

Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9.

Manual edits to the _ssl_data_300.h file prevent it from removing any
existing definitions in case those exist in some peoples builds and were
important (avoiding regressions during backporting).

(cherry picked from commit ede89af)

Co-authored-by: Ned Deily <nad@python.org>
2023-06-05 17:41:51 +02:00
Ned Deily
c9bf00b1ad
[3.9] Update GitHub CI workflow for macOS. (GH-105303) 2023-06-05 02:23:32 -04:00
Ned Deily
89507d5378
[3.9] gh-68966: fix versionchanged in docs (GH-105298) 2023-06-04 23:56:15 -04:00
Miss Islington (bot)
d7f8a5fe07
[3.9] gh-102153: Start stripping C0 control and space chars in urlsplit (GH-102508) (GH-104575) (GH-104592) (#104593)
gh-102153: Start stripping C0 control and space chars in `urlsplit` (GH-102508)

`urllib.parse.urlsplit` has already been respecting the WHATWG spec a bit GH-25595.

This adds more sanitizing to respect the "Remove any leading C0 control or space from input" [rule](https://url.spec.whatwg.org/GH-url-parsing:~:text=Remove%20any%20leading%20and%20trailing%20C0%20control%20or%20space%20from%20input.) in response to [CVE-2023-24329](https://nvd.nist.gov/vuln/detail/CVE-2023-24329).

I simplified the docs by eliding the state of the world explanatory
paragraph in this security release only backport.  (people will see
that in the mainline /3/ docs)

(cherry picked from commit 2f630e1ce1)
(cherry picked from commit 610cc0ab1b)
(cherry picked from commit f48a96a280)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
2023-05-22 12:42:37 +02:00
Miss Islington (bot)
3d5dd1eee2
[3.9] gh-99889: Fix directory traversal security flaw in uu.decode() (GH-104096) (#104331)
(cherry picked from commit 0aeda29793)

Co-authored-by: Sam Carroll <70000253+samcarroll42@users.noreply.github.com>
2023-05-22 12:41:30 +02:00
Miss Islington (bot)
b53d0ff431
[3.9] gh-104049: do not expose on-disk location from SimpleHTTPRequestHandler (GH-104067) (#104120)
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure)

(cherry picked from commit c7c3a60c88)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-22 12:40:50 +02:00
Steve Dower
d1645ce4f1
[3.9] gh-103935: Use io.open_code() when executing code in trace and profile modules (GH-103947) (#103953)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-05-22 12:40:30 +02:00
Petr Viktorin
98016f7c92
[3.9] gh-102950: Implement PEP 706 – Filter for tarfile.extractall (GH-102953) (#104382)
Backport of c8c3956d90
2023-05-15 18:53:58 +02:00
Kumar Aditya
7cb3a44747
[3.9] GH-102126: fix deadlock at shutdown when clearing thread states (GH-102222) (#102236)
(cherry picked from commit 5f11478ce7)
2023-03-28 10:55:36 +02:00
Pradyun Gedam
b5a94301a2
[3.9] gh-101997: Update bundled pip version to 23.0.1 (GH-101998). (#102243)
(cherry picked from commit 89d9ff0f48)
2023-03-28 10:52:56 +02:00
Miss Islington (bot)
cb0b009cfb
[3.9] gh-102627: Replace address pointing toward malicious web page (GH-102630) (GH-102666)
(cherry picked from commit 61479d4684)

Co-authored-by: Blind4Basics <32236948+Blind4Basics@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-03-13 19:28:36 -04:00
Steve Dower
bf99e19b99
[3.9] gh-101726: Update the OpenSSL version to 1.1.1t (GH-101727) (GH-101751)
Fixes CVE-2023-0286 (High) and a couple of Medium security issues.
https://www.openssl.org/news/secadv/20230207.txt

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Ned Deily <nad@python.org>
2023-03-07 18:01:22 -05:00