34 vulnerabilities classified as CWE-378 (创建拥有不安全权限的临时文件). AI Chinese analysis included.
CWE-378 represents a critical security flaw where applications create temporary files with overly permissive access controls, leaving them vulnerable to unauthorized modification or reading. Attackers typically exploit this weakness by predicting the temporary file’s location and name, then creating a malicious file with the same path before the legitimate application does. This allows the attacker to inject harmful content or intercept sensitive data, potentially leading to privilege escalation or data leakage. To mitigate this risk, developers must enforce strict file permissions, such as setting read-write access for the owner only, immediately after file creation. Additionally, utilizing secure system calls that atomically create and secure files, or employing unique, unpredictable filenames, ensures that temporary files remain isolated and protected from pre-emption attacks, thereby maintaining data integrity and confidentiality throughout the application’s lifecycle.
FILE *stream; if( (stream = tmpfile()) == NULL ) { perror("Could not open new temporary file\n"); return (-1); } // write data to tmp file ... // remove tmp file rmtmp();try { File temp = File.createTempFile("pattern", ".suffix"); temp.deleteOnExit(); BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write("aString"); out.close(); } catch (IOException e) { }| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2021-21290 | Local Information Disclosure Vulnerability in Netty on Unix-Like systems due temporary files — netty | 6.2 | Medium | 2021-02-08 |
| CVE-2020-8908 | Temp directory permission issue in Guava — Guava | 3.3 | Low | 2020-12-10 |
| CVE-2020-27216 | Eclipse Jetty 安全漏洞 — Eclipse Jetty | 5.8 | - | 2020-10-23 |
| CVE-2016-9485 | 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 — Windows SecureConnector agent | 7.8 | - | 2018-07-13 |
Vulnerabilities classified as CWE-378 (创建拥有不安全权限的临时文件) represent 34 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.