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.
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.
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: CVE-2022-27818
A hotkey daemon written in Rust creates a domain socket file underneath /tmp, which is accessible by any user.
CVE: 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.
N/A
N/A
Phase | Note |
---|---|
Implementation | N/A |
Intro: 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.
Body: However, within this C/C++ code the method tmpfile() is used to create and open the temp file. The tmpfile() method works the same way as the fopen() method would with read/write permission, allowing attackers to read potentially sensitive information contained in the temp file or modify the contents of the file.
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();