Skip to content
OpenAdvisories

Weakness (CWE)

CWE-378: Creation of Temporary File With Insecure Permissions

Base Draft

Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.

How to prevent it (3 mitigations)
  1. Requirements

    Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.

  2. 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.

  3. 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.

Source: MITRE CWE-378

54 results · Feed

  • High 7.0

    Cisco AnyConnect Secure Mobility Client for Windows DLL and Executable Hijacking Vulnerabilities

    Multiple vulnerabilities in the install, uninstall, and upgrade processes of Cisco AnyConnect Secure Mobility Client for Windows could allow an authenticated, local attacker to hijack DLL or executable files that are used by the application. A successful expl…

  • High 7.0

    Cisco AnyConnect Secure Mobility Client for Windows DLL and Executable Hijacking Vulnerabilities

    Multiple vulnerabilities in the install, uninstall, and upgrade processes of Cisco AnyConnect Secure Mobility Client for Windows could allow an authenticated, local attacker to hijack DLL or executable files that are used by the application. A successful expl…

  • Medium 4.0

    Creation of Temporary File in Directory with Insecure Permissions in the OpenAPI Generator Maven plugin

    OpenAPI Generator allows generation of API client libraries, server stubs, documentation and configuration automatically given an OpenAPI Spec. Using `File.createTempFile` in JDK will result in creating and using insecure temporary files that can leave applic…

  • Medium 6.2

    Local information disclosure via system temporary directory

    Eclipse Jersey 2.28 to 2.33 and Eclipse Jersey 3.0.0 to 3.0.1 contains a local information disclosure vulnerability. This is due to the use of the File.createTempFile which creates a file inside of the system temporary directory with the permissions: -rw-r--r…

  • High 7.8

    hawk: Insecure file permissions

    A Creation of Temporary File With Insecure Permissions vulnerability in hawk2 of SUSE Linux Enterprise High Availability 12-SP3, SUSE Linux Enterprise High Availability 12-SP5, SUSE Linux Enterprise High Availability 15-SP2 allows local attackers to escalate …

  • High 8.8

    Local privilege escalation through system temporary directory

    In Gradle before version 7.0, on Unix-like systems, the system temporary directory can be created with open permissions that allow multiple users to create and delete files within it. Gradle builds could be vulnerable to a local privilege escalation from an a…

  • Medium 5.3

    Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory

    swagger-codegen is an open-source project which contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. In swagger-codegen before version 2.4.19, on Unix li…

  • Medium 5.3

    Generated Code Contains Local Information Disclosure Vulnerability

    swagger-codegen is an open-source project which contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. In swagger-codegen before version 2.4.19, on Unix-Li…

  • Low 3.0

    DataDog API Client contains a Local Information Disclosure Vulnerability

    The Java client for the Datadog API before version 1.0.0-beta.9 has a local information disclosure of sensitive information downloaded via the API using the API Client. The Datadog API is executed on a unix-like system with multiple users. The API is used to …

  • Medium 6.2

    Local Information Disclosure Vulnerability in Netty on Unix-Like systems due temporary files

    Netty is an open-source, asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. In Netty before version 4.1.59.Final there is a vulnerability on Unix-like systems involving an…

  • Low 3.3

    Temp directory permission issue in Guava

    A temp directory creation vulnerability exists in all versions of Guava, allowing an attacker with access to the machine to potentially access data in a temporary directory created by the Guava API com.google.common.io.Files.createTempDir(). By default, on un…

  • High 7.0

    Local Temp Directory Hijacking Vulnerability

    In Eclipse Jetty versions 1.0 thru 9.4.32.v20200930, 10.0.0.alpha1 thru 10.0.0.beta2, and 11.0.0.alpha1 thru 11.0.0.beta2O, on Unix like systems, the system's temporary directory is shared between all users on that system. A collocated user can observe the pr…

  • Unscored —

    On Windows endpoints, the SecureConnector agent is vulnerable to privilege escalation whereby an authenticated unprivileged user can obtain administrator privileges on the endpoint because it fails to set any permissions on downloaded file objects

    On Windows endpoints, the SecureConnector agent must run under the local SYSTEM account or another administrator account in order to enable full functionality of the agent. The typical configuration is for the agent to run as a Windows service under the local…

  • Medium 5.6

    Creation of Temporary File With Insecure Permissions in logilab-commons

    The Execute class in shellutils in logilab-commons before 0.61.0 uses tempfile.mktemp, which allows local users to have an unspecified impact by pre-creating the temporary file.