CVE-2024-4030
CVE-2024-4030 — tempfile.mkdtemp() may be readable and writeable by all users on Windows
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.
Published Updated Sources: cvelistV5, PSF
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the scoring sources call it.
Exploitation
Unreported
no source claims exploitation
EPSS
0%
chance of exploitation in 30 days
CVSS base
7.1
HIGH
CISA SSVC assessment
Three decision points CISA publishes for the CVEs it assesses · SSVC 2.0.3. A stakeholder decision, not a severity score.
Exploitation
None
none · proof-of-concept · active
Automatable
No
can an attacker script all four kill-chain steps
Technical impact
Total
partial · total control of the vulnerable component
Affected scope
The catalog records vendors and products as separate lists, not pairs, so which product belongs to which vendor is not something this page can say.
Vendors (2)
Products (1)
Every base score collected
Sources score independently and disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Source |
|---|---|---|---|---|---|
| 7.1 | CVSS 3.1 | HIGH | — | — | cvelistV5 |
Weakness & attack patterns
- CWE-276
Attack patterns reported against this CVE. The ATT&CK techniques below are inferred from its weakness class.
- T1574.010Hijack Execution Flow: ServicesFile Permissions Weakness
- T1083File and Directory Discovery
References
15 on the record
- mail.python.org/archives/list/[email protected]/thread/PRGS5OR3N3PNPT4BMV2VAGN5GMUI5636/
vendor-advisory
- github.com/python/cpython/issues/118486
issue-tracking
- github.com/python/cpython/commit/81939dad77001556c527485d31a2d0f4a759033e
patch
- github.com/python/cpython/commit/8ed546679524140d8282175411fd141fe7df070d
patch
- github.com/python/cpython/commit/35c799d79177b962ddace2fa068101465570a29a
patch
- github.com/python/cpython/commit/5130731c9e779b97d00a24f54cdce73ce9975dfd
patch
- github.com/python/cpython/commit/66f8bb76a15e64a1bb7688b177ed29e26230fdee
patch
- github.com/python/cpython/commit/6d0850c4c8188035643586ab4d8ec2468abd699e
patch
Elsewhere on this site
- python software foundationevery CVE for this vendor
- pythonevery CVE for this vendor
- CWE-276other pages naming this weakness
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.