CVE-2020-8908: Information Disclosure in Guava

com.google.guava:guava Updated 02 Oct 2025

Summary

25/03/2021
Yes i
Low
3.3

CVE-2020-8908: Information Disclosure in Guava. Affects com.google.guava:guava versions < 32.0.0-android. Fixed in 32.0.0-android. How to fix ↓

Also tracked for

The same CVE-2020-8908 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Guava is an open-source Java library developed by Google that provides utility classes for common programming tasks. It offers a wide range of functionalities, including collections, caching, concurrency, and input/output operations. One of the features provided by Guava is the ability to create temporary directories using the com.google.common.io.Files.createTempDir() method. However, a vulnerability exists in all versions of Guava that can potentially lead to information disclosure. When a temporary directory is created using this method, it inherits the default permissions of the underlying operating system, which are typically the standard Unix-like /tmp permissions. This leaves the files in the temporary directory open and accessible to an attacker with access to the machine.

Vulnerability Detail

The vulnerability allows an attacker with access to the machine to potentially access data in a temporary directory created by Guava's createTempDir() method. By default, the permissions granted to the directory are not secure, making it possible for an attacker to read sensitive information stored in the temporary files. This can lead to the exposure of confidential data, such as user credentials or other sensitive information. The vulnerability has been assigned the CVE identifier CVE-2020-8908 and has a CVSS score of 3.3, indicating a low severity level.

How To Fix

Minimum fixed version

32.0.0-android

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, developers can manually change the permissions of the temporary directory after it is created using the java.nio.file.Files.setPosixFilePermissions() method. By setting the appropriate permissions, the files within the directory can be protected from unauthorized access. Here is an example code snippet that demonstrates how to change the permissions of a temporary directory created by Guava:

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.PosixFilePermission;
import java.util.HashSet;
import java.util.Set;

public class TempDirectoryExample {
    public static void main(String[] args) throws Exception {
        Path tempDir = Files.createTempDirectory(null);
        Set<PosixFilePermission> permissions = new HashSet<>();
        permissions.add(PosixFilePermission.OWNER_READ);
        permissions.add(PosixFilePermission.OWNER_WRITE);
        permissions.add(PosixFilePermission.OWNER_EXECUTE);
        Files.setPosixFilePermissions(tempDir, permissions);
    }
}

Conclusion

In conclusion, the Guava library is vulnerable to an information disclosure issue when creating temporary directories. This vulnerability can potentially lead to the exposure of sensitive data stored in temporary files. To mitigate the risk, it is recommended to change the permissions of the temporary directory after its creation or avoid using the vulnerable method. Developers should also consider using more secure alternatives provided by the operating system or other libraries. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.google.guava:guava →

Share this vulnerability

FAQ

Guava is an open-source Java library developed by Google that provides utility classes for common programming tasks. It offers various functionalities, including collections, caching, concurrency, and input/output operations.

The vulnerability in Guava is an information disclosure issue that arises when creating temporary directories using the com.google.common.io.Files.createTempDir() method. The default permissions granted to the temporary directory leave the files open and accessible to attackers with machine access.

The vulnerability can lead to the exposure of sensitive information stored in temporary files created by Guava. This includes confidential data such as user credentials or other sensitive data that may be present in the temporary directory.

To fix this vulnerability, it is recommended to explicitly change the permissions of the temporary directory after its creation or avoid using the vulnerable method altogether. Additionally, developers should consider using more secure alternatives provided by the operating system or other libraries.

Yes, a workaround is available. Developers can manually change the permissions of the temporary directory using the java.nio.file.Files.setPosixFilePermissions() method. By setting the appropriate permissions, the files within the directory can be protected from unauthorized access.

References

View More

Related vulnerabilities

Recent vulnerabilities recorded for com.google.guava:guava.

How To Fix

Minimum fixed version

32.0.0-android

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback