CWE-379: Creation of Temporary File in Directory with Insecure Permissions
60 CVEs have CWE-379 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 7.757%.
The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.
Mitigations
- Requirements: Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.
- Implementation: Try to store sensitive tempfiles in a directory which is not world readable -- i.e., per-user directories.
- Implementation: Avoid using vulnerable temp file functions.
Observed examples
- CVE-2022-27818: A hotkey daemon written in Rust creates a domain socket file underneath /tmp, which is accessible by any user.
- CVE-2021-41989: analytic platform's repair functionality uses the %TEMP% folder of a user while running with higher privileges
- CVE-2021-21290: A Java-based application for a rapid-development framework uses File.createTempFile() to create a random temporary file with insecure default permissions.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-379'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-379'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).