nixpkgs: Creation of Temporary File With Insecure Permissions
CVE-2025-32438 is a high-severity creation of temporary file with insecure permissions vulnerability in nixpkgs from NixOS, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. Affected nixpkgs versions: < b17590193d8e5697000c23c66afcf11e1753734d; < fbf76bf72b161b9f4ab97704a8258776d5f3ffba. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.19% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of nixpkgs you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| NixOS | nixpkgs | < b17590193d8e5697000c23c66afcf11e1753734d; < fbf76bf72b161b9f4ab97704a8258776d5f3ffba | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- ChangedThe attack can reach beyond the vulnerable component into other systems.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H. Scored by CNA (github.com).
Official description
make-initrd-ng is a tool for copying binaries and their dependencies. Local privilege escalation affecting all NixOS users. With systemd.shutdownRamfs.enable enabled (the default) a local user is able to create a program that will be executed by root during shutdown. Patches exist for NixOS 24.11 and 25.05 / unstable. As a workaround, set systemd.shutdownRamfs.enable = false;.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Creation of Temporary File With Insecure Permissions
Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.
How developers prevent this class of flaw
- Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.
- Ensure that you use proper file permissions. This can be achieved by using a safe temp file function. Temporary files should be writable and readable only by the process that owns the file.
- Randomize temporary file names. This can also be achieved by using a safe temp-file function. This will ensure that temporary files will not be created in predictable places.
More Creation of Temporary File With Insecure Permissions vulnerabilities (CWE-378)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Other vulnerabilities in nixpkgs
- 8.5 High severity
- 9.1 Critical severity
- 8.7 High severity
Recent Creation of Temporary File With Insecure Permissions vulnerabilities
- 8.8 High severity
- 7.8 High severity
- 9.9 Critical severity
Spotted an error? Tell us.