CVE-2025-27148

Source
https://cve.org/CVERecord?id=CVE-2025-27148
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-27148.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-27148
Aliases
Downstream
Related
  • GHSA-2xxp-vw2f-p3x8
  • GHSA-465q-w4mf-4f4r
  • GHSA-89qm-pxvm-p336
Published
2025-02-25T20:13:51.578Z
Modified
2026-04-10T05:23:45.832392Z
Severity
  • 8.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
Gradle vulnerable to local privilege escalation through system temporary directory
Details

Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. On Unix-like systems, the system temporary directory can be created with open permissions that allow multiple users to create and delete files within it. This library initialization could be vulnerable to a local privilege escalation from an attacker quickly deleting and recreating files in the system temporary directory. Gradle builds that rely on versions of net.rubygrapefruit:native-platform prior to 0.22-milestone-28 could be vulnerable to a local privilege escalation from an attacker quickly deleting and recreating files in the system temporary directory.

In net.rubygrapefruit:native-platform prior to version 0.22-milestone-28, if the Native.get(Class<>) method was called, without calling Native.init(File) first, with a non-null argument used as working file path, then the library would initialize itself using the system temporary directory and NativeLibraryLocator.java lines 68 through 78. Version 0.22-milestone-28 has been released with changes that fix the problem. Initialization is now mandatory and no longer uses the system temporary directory, unless such a path is passed for initialization. The only workaround for affected versions is to make sure to do a proper initialization, using a location that is safe.

Gradle 8.12, only that exact version, had codepaths where the initialization of the underlying native integration library took a default path, relying on copying the binaries to the system temporary directory. Any execution of Gradle exposed this exploit. Users of Windows or modern versions of macOS are not vulnerable, nor are users of a Unix-like operating system with the "sticky" bit set or noexec on their system temporary directory vulnerable. This problem was fixed in Gradle 8.12.1. Gradle 8.13 release also upgrades to a version of the native library that no longer has that bug. Some workarounds are available. On Unix-like operating systems, ensure that the "sticky" bit is set. This only allows the original user (or root) to delete a file. Mounting /tmp as noexec will prevent Gradle 8.12 from starting. Those who are are unable to change the permissions of the system temporary directory can move the Java temporary directory by setting the System Property java.io.tmpdir. The new path needs to limit permissions to the build user only.

Database specific
{
    "cwe_ids": [
        "CWE-378",
        "CWE-379"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/27xxx/CVE-2025-27148.json",
    "cna_assigner": "GitHub_M"
}
References

Affected packages

Git / github.com/gradle/gradle

Affected ranges

Type
GIT
Repo
https://github.com/gradle/gradle
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Database specific
{
    "versions": [
        {
            "introduced": "0"
        },
        {
            "last_affected": "= 8.12"
        }
    ]
}

Affected versions

REL-0.*
REL-0.8
REL-0.9-preview-1
REL-0.9-preview-2
REL-0.9-preview-3
REL-0.9-rc-1
REL_0.*
REL_0.9
REL_0.9-rc-2
REL_0.9-rc-3
REL_0.9.1
REL_0.9.2
REL_1.*
REL_1.0-milestone-1
REL_1.0-milestone-2
REL_1.0-milestone-3
REL_1.11
REL_1.11-rc-1
REL_1.12
REL_1.12-rc-1
REL_1.12-rc-2
REL_3.*
REL_3.0-milestone-1
v0.*
v0.8
v0.8.0
v0.9
v0.9-RC1
v0.9-RC2
v0.9-RC3
v0.9.0
v0.9.0-RC1
v0.9.0-RC2
v0.9.0-RC3
v0.9.1
v0.9.2
v1.*
v1.0-M1
v1.0-M2
v1.0-M3
v1.0.0-M1
v1.0.0-M2
v1.0.0-M3
v1.11
v1.11-RC1
v1.11.0
v1.11.0-RC1
v1.12
v1.12-RC1
v1.12-RC2
v1.12.0
v1.12.0-RC1
v1.12.0-RC2
v3.*
v3.0.0-M1
v6.*
v6.1.0-M1
v6.1.0-M2
v6.5.0-M1
v6.5.0-M2
v6.6.0-M1
v6.6.0-M2
v6.8.0-M1
v6.8.0-M2
v6.8.0-M3
v7.*
v7.0.0-M1
v7.0.0-M2
v7.0.0-M3
v8.*
v8.0.0-M2
v8.10.0
v8.10.0-RC1
v8.10.1
v8.10.2
v8.10.2-M1
v8.11.0
v8.11.0-M1
v8.11.0-RC1
v8.11.0-RC2
v8.11.0-RC3
v8.11.1
v8.12.0
v8.12.0-RC1
v8.12.0-RC2
v8.3.0
v8.3.0-RC1
v8.3.0-RC2
v8.3.0-RC3
v8.3.0-RC4
v8.4.0
v8.4.0-RC1
v8.4.0-RC2
v8.4.0-RC3
v8.5.0
v8.5.0-RC1
v8.5.0-RC2
v8.5.0-RC3
v8.5.0-RC4
v8.6.0
v8.6.0-RC1
v8.6.0-RC2
v8.6.0-RC3
v8.6.0-RC4
v8.7.0
v8.7.0-RC1
v8.7.0-RC2
v8.7.0-RC3
v8.7.0-RC4
v8.8.0
v8.8.0-RC1
v8.8.0-RC2
v8.9.0
v8.9.0-RC1
v8.9.0-RC2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-27148.json"