CWEweakness
CWE-378 Creation of Temporary File With Insecure Permissions
High
Official page ↗
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- High
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.
Common consequences
• Confidentiality: Read Application Data — If the temporary file can be read by the attacker, sensitive information may be in that file which could be revealed.
• Authorization, Other: Other — If that file can be written to by the attacker, the file might be moved into a place to which the attacker does not have access. This will allow the attacker to gain selective resource access-control privileges.
• Integrity, Other: Other — Depending on the data stored in the temporary file, there is the potential for an attacker to gain an additional input vector which is trusted as non-malicious. It may be possible to make arbitrary changes to data structures, user information, or even process ownership.
Potential mitigations
• [Requirements] Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.
• [Implementation] 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.
• [Implementation] 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.
Detection methods
• Automated Static Analysis: 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.)
Observed examples
• CVE-2022-24823: A network application framework uses the Java function createTempFile(), which will create a file that is readable by other local users of the system
• CVE-2022-41954: A library uses the Java File.createTempFile() method which creates a file with "-rw-r--r--" default permissions on Unix-like operating systems
Related
Child of · not in database (1)
Observed example · CVE (2)
- CVE-2022-41954 MPXJ is an open source library to read and write project plans from a variety of file formats and databases. vulnerability
- CVE-2022-24823 Netty is an open-source, asynchronous event-driven network application framework. vulnerability
Referenced by CVE · weakness (49)
- CVE-2026-97025 Flatpak writes the OCI repository authentication token with world-readable permissions (0644) in the system-helper's cache directory,… vulnerability
- CVE-2026-97026 Flatpak creates temporary child repository directories under the user cache with world-writable permissions (0777). vulnerability
- CVE-2026-25265 Privilege escalation due to weak configuration while temporary file handling. vulnerability
- CVE-2026-46388 osquery is a SQL powered operating system instrumentation, monitoring, and analytics framework. vulnerability
- CVE-2026-4137 In mlflow/mlflow versions prior to 3.11.0, the `get_or_create_nfs_tmp_dir()` function in `mlflow/utils/file_utils.py` creates temporary… vulnerability
- CVE-2026-33572 OpenClaw before 2026.2.17 creates session transcript JSONL files with overly broad default permissions, allowing local users to read… vulnerability
- CVE-2026-4822 A vulnerability was detected in Enter Software Iperius Backup up to 8.7.3. vulnerability
- CVE-2026-2817 Use of insecure directory in Spring Data Geode snapshot import extracts archives into predictable, permissive directories under the system… vulnerability
- CVE-2025-46684 Dell SupportAssist OS Recovery, versions prior to 5.5.15.1, contain a Creation of Temporary File With Insecure Permissions vulnerability. vulnerability
- CVE-2025-46685 Dell SupportAssist OS Recovery, versions prior to 5.5.15.1, contain a Creation of Temporary File With Insecure Permissions vulnerability. vulnerability
- CVE-2025-34352 JumpCloud Remote Assist for Windows versions prior to 0.317.0 include an uninstaller that is invoked by the JumpCloud Windows Agent as NT… vulnerability
- CVE-2025-7647 The llama-index-core package, up to version 0.12.44, contains a vulnerability in the `get_cache_dir()` function where a predictable,… vulnerability
- CVE-2025-4953 A flaw was found in Podman. vulnerability
- CVE-2025-9474 A vulnerability was detected in Mihomo Party up to 1.8.1 on macOS. vulnerability
- CVE-2025-55629 Insecure permissions in Reolink Smart 2K+ Plug-in Wi-Fi Video Doorbell with Chime - firmware v3.0.0.4662_2503122283 allow attackers to… vulnerability
- CVE-2025-38747 Dell SupportAssist OS Recovery, versions prior to 5.5.14.0, contain a Creation of Temporary File With Insecure Permissions vulnerability. vulnerability
- CVE-2025-32979 NETSCOUT nGeniusONE before 6.4.0 b2350 allows Arbitrary File Creation by authenticated users. vulnerability
- CVE-2025-32438 make-initrd-ng is a tool for copying binaries and their dependencies. vulnerability
- CVE-2025-27148 Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. vulnerability
- CVE-2024-52543 Dell NativeEdge, version(s) 2.1.0.0, contain(s) a Creation of Temporary File With Insecure Permissions vulnerability. vulnerability
- CVE-2024-47884 foxmarks is a CLI read-only interface for Firefox's bookmarks and history. vulnerability
- CVE-2024-23454 Apache Hadoop’s RunJar.run() does not set permissions for temporary directory by default. vulnerability
- CVE-2024-7358 A vulnerability was found in Point B Ltd Getscreen Agent 2.19.6 on Windows. vulnerability
- CVE-2024-42052 The MSI installer for Splashtop Streamer for Windows before 3.5.8.0 uses a temporary folder with weak permissions during installation. vulnerability
- CVE-2024-39872 A vulnerability has been identified in SINEMA Remote Connect Server (All versions < V3.2 SP1). vulnerability
- CVE-2023-26603 JumpCloud Agent before 1.178.0 Creates a Temporary File in a Directory with Insecure Permissions. vulnerability
- CVE-2023-28600 Zoom for MacOSclients prior to 5.14.0 contain an improper access control vulnerability. vulnerability
- CVE-2023-27408 A vulnerability has been identified in SCALANCE LPE9403 (All versions < V2.1). vulnerability
- CVE-2023-0481 In RestEasy Reactive implementation of Quarkus the insecure File.createTempFile() is used in the FileBodyHandler class which creates temp… vulnerability
- CVE-2023-0482 In RESTEasy the insecure File.createTempFile() is used in the DataSourceProvider, FileProvider and Mime4JWorkaround classes which creates… vulnerability