CVE-2024-5300: Insecure Temp File Creation

Constructing temporary files manually using random strings is vulnerable to predictable temp file collision attacks (Insecure Temporary File). An attacker who can predict the target path and pseudorandom component can pre-create the file and trigger Denial of Service or unauthorized access. Use standard secure temp file creation utilities like `os.CreateTemp

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Go
greprules fetch cve-2024-5300-insecure-temp-file-creation --engine opengrep

Description

Constructing temporary files manually using random strings is vulnerable to predictable temp file collision attacks (Insecure Temporary File). An attacker who can predict the target path and pseudorandom component can pre-create the file and trigger Denial of Service or unauthorized access. Use standard secure temp file creation utilities like `os.CreateTemp