CWE-379: Creation of Temporary File in Directory with Insecure Permissions
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.
Last updated
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.
Last updated
64 recorded CVEs are caused by CWE-379 (Creation of Temporary File in Directory with Insecure Permissions). The highest-severity and most recent are shown first. 20 new CWE-379 CVEs have been recorded so far in 2026 (6 in 2025).
Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory
Local Privilege Escalation in servereye client (sensorhub)
Local Privilege Escalation in pyinstaller on Windows
Local privilege escalation through system temporary directory
Abuse of Unauthenticated Compliance Recheck in SecureConnector
pytorch/serve: Local privilege escalation through insecure temporary path
OpenTelemetry.Exporter.OpenTelemetryProtocol: Disk retry default temp path enables local blob injection for OTLP Exporter
Autodesk ADP Desktop SDK Privilege Escalation Vulnerability
Privilege Escalation to SYSTEM in Lakeside Software Installer
Insecure Permissions in Splashtop Software Updater
Showing 12 of 64 recorded CWE-379 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsWhat can happen when CWE-379 is exploited.
Read Application Data
Affects: Confidentiality
On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.
Typically introduced during these phases of the software lifecycle.
Practical mitigations for CWE-379, grouped by where in the lifecycle they apply.
Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.
Try to store sensitive tempfiles in a directory which is not world readable -- i.e., per-user directories.
Avoid using vulnerable temp file functions.
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
MITRE examples of the weakness in code.
In the following code examples a temporary file is created and written to. After using the temporary file, the file is closed and deleted from the file system.
Vulnerable example
FILE *stream;
if( (stream = tmpfile()) == NULL ) {
perror("Could not open new temporary file\n");
return (-1);
}
// write data to tmp file
...
// remove tmp file
rmtmp();Vulnerable example
try {
File temp = File.createTempFile("pattern", ".suffix");
temp.deleteOnExit();
BufferedWriter out = new BufferedWriter(new FileWriter(temp));
out.write("aString");
out.close();
}
catch (IOException e) {
}Real CVEs that MITRE cites as examples of this weakness.
Common questions about CWE-379.
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Get an alert when a new CWE-379 CVE affects your products, with AI-written analysis and remediation steps.