CVE-2023-2976:
Guava vulnerable to insecure use of temporary directory
5.5
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
6/14/2023
Updated
2/13/2025
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
com.google.guava:guava | maven | >= 1.0, < 32.0.0-android | 32.0.0-android |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The analysis is based on the provided commit feb83a1c8fd2e7670b244d5afd23cba5aca43284
, which addresses the insecure use of temporary directories.
The vulnerability description specifically mentions FileBackedOutputStream
. The commit modifies this class and Files.createTempDir()
to use a new, secure TempFileCreator
.
-
com.google.common.io.FileBackedOutputStream
:- The constructors (
<init>(int)
and<init>(int, boolean)
) are identified as vulnerable because they initialized the stream in a way that would lead to insecure temporary file creation. They previously passednull
as theparentDirectory
to an internal mechanism, causing theupdate(int)
method to useFile.createTempFile
with the system's default temporary directory. - The
update(int)
method is identified because it contained the actual call toFile.createTempFile(..., parentDirectory)
, whereparentDirectory
could benull
, leading to the insecure behavior.
- The constructors (
-
com.google.common.io.Files.createTempDir()
:- This method is identified as vulnerable because its original implementation created a directory in the default system temporary path (
java.io.tmpdir
) without ensuring appropriate, restricted permissions.
- This method is identified as vulnerable because its original implementation created a directory in the default system temporary path (
The patch replaces these vulnerable behaviors by delegating temporary file and directory creation to TempFileCreator.INSTANCE
, which is designed to create them securely or fail if secure creation is not possible. The identified functions are those that contained the insecure logic before this fix.