CyberSecBulletin

Creation of Temporary File With Insecure Permissions

CWE-378

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

We track 13 vulnerabilities of this type. 100% are rated high or critical, and the average CVSS score is 8.0.

How this weakness is prevented

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

Latest Creation of Temporary File With Insecure Permissions vulnerabilities