CVE-2024-4030
tempfile.mkdtemp() may be readable and writeable by all users on Windows
Reported by psf · Published May 7, 2024
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| alpine/python-3.10 | alpine | 3.13.0-beta2, 3.12.4, 3.11.10, 3.10.15, 3.9.20, 3.8.20 |
| debian/python-3.12 | debian | 3.13.0-beta2, 3.12.4, 3.11.10, 3.10.15, 3.9.20, 3.8.20 |
| debian/python-3.11 | debian | 3.13.0-beta2, 3.12.4, 3.11.10, 3.10.15, 3.9.20, 3.8.20 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Python Software Foundation | CPython | 0, 3.9.0, 3.10.0 |
| chainguard | python-3.8 | * |
| python | cpython | 3.13.0a1, 0 |
| Python Software Foundation | CPython | 3.12.0, 3.13.0a1, 0 |
| Python Software Foundation | CPython | |
| chainguard | python-3.9 | * |
| wolfi | aws-cli-v2 | * |
| wolfi | python-3.11 | * |
| chainguard | python-3.11 | * |
| wolfi | python-3.10 | * |
| chainguard | python-3.10 | * |
| chainguard | aws-cli-v2 | * |
| chainguard | python-3.12 | * |
| wolfi | python-3.12 | * |
Timeline
- May 7, 2024 CVE Published
- May 8, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (13 in total, the first dated here)
- Jun 2, 2026 Security Advisory (4 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-4030
vulnetix vdb fixes CVE-2024-4030
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-4030/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart