CVE-2025-27148

8.8 HIGH

📋 TL;DR

This vulnerability allows local privilege escalation on Unix-like systems when Gradle builds use vulnerable versions of the native-platform library. Attackers can exploit insecure temporary directory permissions to delete and recreate files, potentially gaining elevated privileges. Only Gradle 8.12 users on Unix-like systems without proper temporary directory protections are affected.

💻 Affected Systems

Products:
  • Gradle
  • net.rubygrapefruit:native-platform
Versions: Gradle 8.12 only; native-platform prior to 0.22-milestone-28
Operating Systems: Unix-like systems (Linux, BSD, etc.)
Default Config Vulnerable: ⚠️ Yes
Notes: Not vulnerable on Windows or modern macOS. Unix systems with sticky bit set or noexec on /tmp are protected.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local attacker gains root privileges on the system, enabling complete system compromise and data exfiltration.

🟠

Likely Case

Local user escalates privileges to execute arbitrary code with higher permissions than intended.

🟢

If Mitigated

No impact when proper temporary directory permissions or workarounds are implemented.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring existing local access.
🏢 Internal Only: HIGH - Internal users with local access could exploit this to gain elevated privileges.

🎯 Exploit Status

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

Requires local access and race condition exploitation in temporary directory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Gradle 8.12.1 or 8.13; native-platform 0.22-milestone-28

Vendor Advisory: https://github.com/gradle/gradle/security/advisories/GHSA-465q-w4mf-4f4r

Restart Required: No

Instructions:

1. Update Gradle to version 8.12.1 or 8.13. 2. Update native-platform dependency to 0.22-milestone-28 or later. 3. Rebuild projects with updated versions.

🔧 Temporary Workarounds

Set sticky bit on /tmp

Unix-like

Prevents users from deleting files they don't own in temporary directory

chmod +t /tmp

Mount /tmp with noexec

Unix-like

Prevents execution of binaries from temporary directory

Edit /etc/fstab to add 'noexec' option to /tmp mount

Change Java temporary directory

all

Move temporary directory to secure location with restricted permissions

java -Djava.io.tmpdir=/secure/tmp/path ...

🧯 If You Can't Patch

  • Ensure proper initialization of native library with Native.init(File) using secure path
  • Implement strict file permissions on system temporary directory

🔍 How to Verify

Check if Vulnerable:

Check Gradle version: gradle --version | grep 'Gradle 8.12' (exact match). Check if on Unix-like system without /tmp sticky bit.

Check Version:

gradle --version

Verify Fix Applied:

Verify Gradle version is 8.12.1 or higher. Check native-platform dependency version in build.gradle.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file operations in /tmp directory during Gradle builds
  • Permission denied errors when accessing temporary files

Network Indicators:

  • None - local attack only

SIEM Query:

Process execution: gradle AND File creation/deletion in /tmp with rapid succession

🔗 References

📤 Share & Export