Guava Libraries Temp Directory Vulnerability - CVE-2020-8908

guava-libraries Updated 02 Oct 2025

Summary

10/12/2020
N/A
No i
Low
3.3

CVE-2020-8908: A temp directory creation vulnerability exists in all versions of Guava, allowing an attacker with access to the machine to potentially access data in a temporary directory created by the Guava API com.google.common.io.F... Affects guava-libraries across 2 version ranges.

< 60a549cadba9f9e10583b4348b5102e8b4087aa7 < fec0dbc4634006a6162cfd4d0d09c962073ddf40

No fix is published. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Guava is a set of core libraries for Java, developed by Google, that provides utilities for collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and more. It is widely used in Java applications for its robust features and ease of use. However, a vulnerability exists in all versions of Guava related to the creation of temporary directories, which can expose sensitive data to unauthorized access.

Vulnerability Detail

A temp directory creation vulnerability exists in all versions of Guava, allowing an attacker with access to the machine to potentially access data in a temporary directory created by the Guava API com.google.common.io.Files.createTempDir(). By default, on unix-like systems, the created directory is world-readable, making it susceptible to unauthorized access. This vulnerability has been marked as @Deprecated in versions 30.0 and later, indicating that it should not be used. The potential ramifications include data leakage and unauthorized access to sensitive information stored in temporary directories.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate migration is not feasible, a temporary workaround is to manually set the permissions of the created temporary directory after its creation. This can be done using the following code snippet:

import java.io.File;
import java.io.IOException;

public class TempDirWorkaround { public static void main(String[] args) throws IOException { File tempDir =

File.createTempFile("tempDir", null);
    tempDir.delete(); // delete the file to create a directory
        tempDir.mkdir();
        tempDir.setReadable(false);
        tempDir.setWritable(true);
        tempDir.setExecutable(true);
    }
}

Conclusion

The Guava Libraries vulnerability CVE-2020-8908 poses a significant risk due to the insecure creation of temporary directories. Developers are urged to migrate to safer alternatives to protect sensitive data and mitigate potential security risks.

See every vulnerability recorded for guava-libraries →

Share this vulnerability

FAQ

CVE-2020-8908 is a vulnerability in the Guava libraries that allows unauthorized access to temporary directories created by the API, potentially exposing sensitive data.

All versions of Guava are affected by this vulnerability, but it has been marked as @Deprecated in versions 30.0 and later.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application using the Vulert playground without any signup.

The recommended fix is to migrate to safer alternatives for creating temporary directories, such as using java.nio.file.Files.createTempDirectory() or Android's context.getCacheDir().

The potential consequences include data leakage and unauthorized access to sensitive information stored in temporary directories, which can lead to security breaches.

Related vulnerabilities

Recent vulnerabilities recorded for guava-libraries.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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