CVE-2024-4030
tempfile.mkdtemp() may be readable and writeable by all users on Windows
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
On Windows a directory returned by tempfile.mkdtemp() would not always have permissions set to restrict reading and writing to the temporary directory by other users, instead usually inheriting the correct permissions from the default location. Alternate configurations or users without a profile directory may not have the intended permissions.
If you’re not using Windows or haven’t changed the temporary directory location then you aren’t affected by this vulnerability. On other platforms the returned directory is consistently readable and writable only by the current user.
This issue was caused by Python not supporting Unix permissions on Windows. The fix adds support for Unix “700” for the mkdir function on Windows which is used by mkdtemp() to ensure the newly created directory has the proper permissions.
En Windows, un directorio devuelto por tempfile.mkdtemp() no siempre tendría permisos configurados para restringir la lectura y escritura en el directorio temporal por parte de otros usuarios, sino que normalmente heredaría los permisos correctos de la ubicación predeterminada. Es posible que las configuraciones alternativas o los usuarios sin un directorio de perfil no tengan los permisos previstos. Si no está utilizando Windows o no ha cambiado la ubicación del directorio temporal, esta vulnerabilidad no le afecta. En otras plataformas, el directorio devuelto solo el usuario actual puede leerlo y escribirlo constantemente. Este problema se debió a que Python no admite permisos de Unix en Windows. La solución agrega soporte para Unix “700” para la función mkdir en Windows que utiliza mkdtemp() para garantizar que el directorio recién creado tenga los permisos adecuados.
CVSS Scores
SSVC
- Decision:Track*
Timeline
- 2024-04-22 CVE Reserved
- 2024-05-07 CVE Published
- 2024-06-14 EPSS Updated
- 2024-09-07 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-276: Incorrect Default Permissions
CAPEC
- CAPEC-1: Accessing Functionality Not Properly Constrained by ACLs
References (15)
URL | Tag | Source |
---|---|---|
https://github.com/python/cpython/issues/118486 | Issue Tracking | |
https://security.netapp.com/advisory/ntap-20240705-0005 |
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | < 3.8.20 Search vendor "Python Software Foundation" for product "CPython" and version " < 3.8.20" | en |
Affected
| ||||||
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | >= 3.9.0 < 3.9.20 Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.9.0 < 3.9.20" | en |
Affected
| ||||||
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | >= 3.10.0 < 3.10.15 Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.10.0 < 3.10.15" | en |
Affected
| ||||||
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | >= 3.11.0 < 3.11.10 Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.11.0 < 3.11.10" | en |
Affected
| ||||||
Python Software Foundation Search vendor "Python Software Foundation" | CPython Search vendor "Python Software Foundation" for product "CPython" | >= 3.12.0 < 3.12.4 Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.12.0 < 3.12.4" | en |
Affected
|