CVE-2020-8908

3.3 LOW

📋 TL;DR

This vulnerability in Google Guava's createTempDir() method creates temporary directories with world-readable permissions on Unix-like systems, allowing any user on the same machine to potentially read sensitive data stored in these directories. All versions of Guava before 30.0 are affected, and the issue impacts any Java application using this deprecated method for temporary directory creation.

💻 Affected Systems

Products:
  • Google Guava
Versions: All versions before 30.0
Operating Systems: Unix-like systems (Linux, macOS, BSD)
Default Config Vulnerable: ⚠️ Yes
Notes: Windows systems are not affected as they have different permission models. Android applications using Guava are also affected but have different remediation paths.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker with local access could read sensitive application data, configuration files, or temporary credentials stored in world-readable temporary directories created by vulnerable applications.

🟠

Likely Case

Information disclosure of temporary files or data stored in vulnerable temporary directories by applications using the deprecated Guava method.

🟢

If Mitigated

Minimal impact if proper directory permissions are configured or alternative APIs are used.

🌐 Internet-Facing: LOW - This is a local privilege issue requiring attacker access to the host system.
🏢 Internal Only: MEDIUM - Internal attackers or compromised accounts could exploit this to access sensitive temporary data.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access to the system and knowledge of where temporary directories are created. The vulnerability is straightforward to exploit once an attacker has access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Guava 30.0 and later

Vendor Advisory: https://github.com/google/guava/commit/fec0dbc4634006a6162cfd4d0d09c962073ddf40

Restart Required: Yes

Instructions:

1. Update Guava dependency to version 30.0 or later. 2. Replace all uses of com.google.common.io.Files.createTempDir() with java.nio.file.Files.createTempDirectory(). 3. Restart affected applications.

🔧 Temporary Workarounds

Configure Java temp directory permissions

linux

Set system-wide permissions for Java temporary directories to restrict access

chmod 700 /tmp/java-*
chmod 700 /var/tmp/java-*

Set secure java.io.tmpdir

all

Configure Java to use a temporary directory with proper permissions

java -Djava.io.tmpdir=/secure/tmp/dir YourApplication

🧯 If You Can't Patch

  • Audit codebase for uses of com.google.common.io.Files.createTempDir() and manually implement secure directory creation
  • Implement application-level permission checks and monitoring for temporary directory access

🔍 How to Verify

Check if Vulnerable:

Check if application uses Guava version <30.0 and calls com.google.common.io.Files.createTempDir() method

Check Version:

mvn dependency:tree | grep guava OR gradle dependencies | grep guava

Verify Fix Applied:

Verify Guava version is ≥30.0 and createTempDir() calls are replaced with java.nio.file.Files.createTempDirectory()

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed permission checks on temporary directories
  • Unexpected directory listing attempts in /tmp or temp directories

Network Indicators:

  • None - this is a local file system vulnerability

SIEM Query:

process.name:java AND file.path:/tmp/* AND file.permissions:world_readable

🔗 References

📤 Share & Export