GLSA-202405-01 : Python, PyPy3: Multiple Vulnerabilities

high Nessus Plugin ID 194974

Description

The remote host is affected by the vulnerability described in GLSA-202405-01 (Python, PyPy3: Multiple Vulnerabilities)

- An issue was found in CPython 3.12.0 `subprocess` module on POSIX platforms. The issue was fixed in CPython 3.12.1 and does not affect other stable releases. When using the `extra_groups=` parameter with an empty list as a value (ie `extra_groups=[]`) the logic regressed to not call `setgroups(0, NULL)` before calling `exec()`, thus not dropping the original processes' groups before starting the new process. There is no issue when the parameter isn't used or when any value is used besides an empty list. This issue only impacts CPython processes run with sufficient privilege to make the `setgroups` system call (typically `root`). (CVE-2023-6507)

- An issue was found in the CPython `tempfile.TemporaryDirectory` class affecting versions 3.12.1, 3.11.7, 3.10.13, 3.9.18, and 3.8.18 and prior. The tempfile.TemporaryDirectory class would dereference symlinks during cleanup of permissions-related errors. This means users which can run privileged programs are potentially able to modify permissions of files referenced by symlinks in some circumstances.
(CVE-2023-6597)

- An issue in the urllib.parse component of Python before 3.11.4 allows attackers to bypass blocklisting methods by supplying a URL that starts with blank characters. (CVE-2023-24329)

- 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. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as not connected and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.) (CVE-2023-40217)

- An issue was discovered in Python 3.11 through 3.11.4. If a path containing '\0' bytes is passed to os.path.normpath(), the path will be truncated unexpectedly at the first '\0' byte. There are plausible cases in which an application would have rejected a filename for security reasons in Python 3.10.x or earlier, but that filename is no longer rejected in Python 3.11.x. (CVE-2023-41105)

- An issue was found in the CPython `zipfile` module affecting versions 3.12.1, 3.11.7, 3.10.13, 3.9.18, and 3.8.18 and prior. The zipfile module is vulnerable to quoted-overlap zip-bombs which exploit the zip format to create a zip-bomb with a high compression ratio. The fixed versions of CPython makes the zipfile module reject zip archives which overlap entries in the archive. (CVE-2024-0450)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

All Python, PyPy3 users should upgrade to the latest version:

# emerge --sync # emerge --ask --oneshot --verbose >=dev-lang/python-3.12.1:3.12 # emerge --ask --oneshot --verbose >=dev-lang/python-3.11.9:3.11 # emerge --ask --oneshot --verbose >=dev-lang/python-3.10.14:3.10 # emerge --ask --oneshot --verbose >=dev-lang/python-3.9.19:3.9 # emerge --ask --oneshot --verbose >=dev-lang/python-3.8.19:3.8 # emerge --ask --oneshot --verbose >=dev-python/pypy3-7.3.16 # emerge --ask --oneshot --verbose >=dev-python/pypy3_10-7.3.16 # emerge --ask --oneshot --verbose >=dev-python/pypy3_9-7.3.16

See Also

https://security.gentoo.org/glsa/202405-01

https://bugs.gentoo.org/show_bug.cgi?id=884653

https://bugs.gentoo.org/show_bug.cgi?id=897958

https://bugs.gentoo.org/show_bug.cgi?id=908018

https://bugs.gentoo.org/show_bug.cgi?id=912976

https://bugs.gentoo.org/show_bug.cgi?id=919475

https://bugs.gentoo.org/show_bug.cgi?id=927299

Plugin Details

Severity: High

ID: 194974

File Name: gentoo_GLSA-202405-01.nasl

Version: 1.0

Type: local

Published: 5/4/2024

Updated: 5/4/2024

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: High

Score: 7.1

CVSS v2

Risk Factor: High

Base Score: 7.8

Temporal Score: 6.1

Vector: CVSS2#AV:N/AC:L/Au:N/C:N/I:C/A:N

CVSS Score Source: CVE-2023-41105

CVSS v3

Risk Factor: High

Base Score: 7.5

Temporal Score: 6.7

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Temporal Vector: CVSS:3.0/E:P/RL:O/RC:C

Vulnerability Information

CPE: p-cpe:/a:gentoo:linux:pypy3, p-cpe:/a:gentoo:linux:pypy3_9, cpe:/o:gentoo:linux, p-cpe:/a:gentoo:linux:python, p-cpe:/a:gentoo:linux:pypy3_10

Required KB Items: Host/local_checks_enabled, Host/Gentoo/release, Host/Gentoo/qpkg-list

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 5/4/2024

Vulnerability Publication Date: 2/17/2023

Reference Information

CVE: CVE-2023-24329, CVE-2023-40217, CVE-2023-41105, CVE-2023-6507, CVE-2023-6597, CVE-2024-0450