Cyber Posture

CVE-2025-27148

High

Published: 25 February 2025

Published
25 February 2025
Modified
15 April 2026
KEV Added
Patch
CVSS Score 8.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS Score 0.0006 19.8th percentile
Risk Priority 18 60% EPSS · 20% KEV · 20% CVSS

Description

Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.

Security Summary

CVE-2025-27148 is a local privilege escalation vulnerability in the net.rubygrapefruit:native-platform library, versions prior to 0.22-milestone-28, which provides Java bindings for native APIs in Gradle, a build automation tool. The issue arises on Unix-like systems where the system temporary directory has open permissions allowing multiple users to create and delete files. If the Native.get(Class<>) method is called without prior Native.init(File) initialization and with a non-null working file path, the library initializes using the system temporary directory, making it susceptible to a time-of-check to time-of-use race condition where an attacker can delete and recreate files during this process. This specifically affects Gradle 8.12, which had code paths relying on copying binaries to the system temporary directory without proper safeguards.

A local attacker with low privileges (PR:L) on vulnerable Unix-like systems can exploit this by racing to manipulate files in the system temporary directory during library initialization, triggered by any Gradle execution. Successful exploitation leads to high confidentiality, integrity, and availability impacts (C:H/I:H/A:H) with changed scope (S:C), as scored at CVSS 8.8 (AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H). Windows and modern macOS users are unaffected, as are Unix-like systems with the sticky bit set on the temporary directory or mounted with noexec.

Gradle security advisories (GHSA-465q-w4mf-4f4r, GHSA-89qm-pxvm-p336) and the fixing pull request (gradle/gradle#32025) recommend updating to net.rubygrapefruit:native-platform 0.22-milestone-28 or later, Gradle 8.12.1, or Gradle 8.13, which mandate proper initialization avoiding the system temporary directory unless explicitly provided. Workarounds for affected versions include calling Native.init(File) with a safe path, setting the sticky bit on the system temporary directory to restrict deletions, mounting it noexec (which prevents Gradle 8.12 startup), or setting the java.io.tmpdir system property to a user-only accessible directory.

This vulnerability is tied to CWEs-378 and CWE-379 (insecure temp file creation/deletion) and highlights risks in multi-user environments without standard Unix protections like sticky bits on /tmp. No real-world exploitation is documented in the provided details.

Details

CWE(s)
CWE-378CWE-379

MITRE ATT&CK Enterprise Techniques

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
Why these techniques?

This local privilege escalation vulnerability via TOCTOU race condition in insecure temporary file handling directly enables exploitation for privilege escalation on Unix-like systems.

Confidence: HIGH · MITRE ATT&CK Enterprise v19.0

References