CWE-379

Creation of Temporary File in Directory with Insecure Permissions

Medium

Description

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.

Potential Impact

How to Fix

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.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-379 vulnerabilities in your codebase.

Get Security Assessment