67 vulnerabilities classified as CWE-377 (不安全的临时文件). AI Chinese analysis included.
CWE-377 represents a critical software weakness involving the creation and use of insecure temporary files, which exposes sensitive application and system data to potential compromise. This vulnerability is typically exploited by attackers who predict or guess the filename of a temporary file, allowing them to create a symbolic link or a malicious file with the same name before the legitimate application writes to it. This substitution enables the attacker to overwrite critical data, execute arbitrary code, or escalate privileges by tricking the application into interacting with the malicious file instead of the intended temporary storage. To mitigate this risk, developers must ensure that temporary files are created with strict access controls, such as using secure file creation flags that prevent race conditions. Additionally, employing unique, unpredictable filenames and storing temporary data in directories with restricted permissions significantly reduces the attack surface, ensuring that only the intended process can access the sensitive information.
if (tmpnam_r(filename)) { FILE* tmp = fopen(filename,"wb+"); while((recv(sock,recvbuf,DATA_SIZE, 0) > 0)&(amt!=0)) amt = fwrite(recvbuf,1,DATA_SIZE,tmp); } ...Vulnerabilities classified as CWE-377 (不安全的临时文件) represent 67 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.