Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
Vulnerability Details :

CVE-2025-27148

Summary
Assigner-GitHub_M
Assigner Org ID-a0819718-46f1-4df5-94e2-005712e83aaa
Published At-25 Feb, 2025 | 20:13
Updated At-25 Feb, 2025 | 21:20
Rejected At-
Credits

Gradle vulnerable to local privilege escalation through system temporary directory

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.

Vendors
-
Not available
Products
-
Metrics (CVSS)
VersionBase scoreBase severityVector
Weaknesses
Attack Patterns
Solution/Workaround
References
HyperlinkResource Type
EPSS History
Score
Latest Score
-
N/A
No data available for selected date range
Percentile
Latest Percentile
-
N/A
No data available for selected date range
Stakeholder-Specific Vulnerability Categorization (SSVC)
▼Common Vulnerabilities and Exposures (CVE)
cve.org
Assigner:GitHub_M
Assigner Org ID:a0819718-46f1-4df5-94e2-005712e83aaa
Published At:25 Feb, 2025 | 20:13
Updated At:25 Feb, 2025 | 21:20
Rejected At:
▼CVE Numbering Authority (CNA)
Gradle vulnerable to local privilege escalation through system temporary directory

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.

Affected Products
Vendor
Gradle, Inc.gradle
Product
gradle
Versions
Affected
  • = 8.12
Problem Types
TypeCWE IDDescription
CWECWE-378CWE-378: Creation of Temporary File With Insecure Permissions
CWECWE-379CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Type: CWE
CWE ID: CWE-378
Description: CWE-378: Creation of Temporary File With Insecure Permissions
Type: CWE
CWE ID: CWE-379
Description: CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Metrics
VersionBase scoreBase severityVector
3.18.8HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Version: 3.1
Base score: 8.8
Base severity: HIGH
Vector:
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Metrics Other Info
Impacts
CAPEC IDDescription
Solutions

Configurations

Workarounds

Exploits

Credits

Timeline
EventDate
Replaced By

Rejected Reason

References
HyperlinkResource
https://github.com/gradle/gradle/security/advisories/GHSA-465q-w4mf-4f4r
x_refsource_CONFIRM
https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336
x_refsource_MISC
https://github.com/gradle/native-platform/security/advisories/GHSA-2xxp-vw2f-p3x8
x_refsource_MISC
https://github.com/gradle/gradle/pull/32025
x_refsource_MISC
https://github.com/gradle/native-platform/pull/353
x_refsource_MISC
https://en.wikipedia.org/wiki/Fstab#Options_common_to_all_filesystems
x_refsource_MISC
https://en.wikipedia.org/wiki/Sticky_bit
x_refsource_MISC
https://github.com/gradle/native-platform/blob/574dfe8d9fb546c990436468d617ab81c140871d/native-platform/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java#L68-L78
x_refsource_MISC
Hyperlink: https://github.com/gradle/gradle/security/advisories/GHSA-465q-w4mf-4f4r
Resource:
x_refsource_CONFIRM
Hyperlink: https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336
Resource:
x_refsource_MISC
Hyperlink: https://github.com/gradle/native-platform/security/advisories/GHSA-2xxp-vw2f-p3x8
Resource:
x_refsource_MISC
Hyperlink: https://github.com/gradle/gradle/pull/32025
Resource:
x_refsource_MISC
Hyperlink: https://github.com/gradle/native-platform/pull/353
Resource:
x_refsource_MISC
Hyperlink: https://en.wikipedia.org/wiki/Fstab#Options_common_to_all_filesystems
Resource:
x_refsource_MISC
Hyperlink: https://en.wikipedia.org/wiki/Sticky_bit
Resource:
x_refsource_MISC
Hyperlink: https://github.com/gradle/native-platform/blob/574dfe8d9fb546c990436468d617ab81c140871d/native-platform/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java#L68-L78
Resource:
x_refsource_MISC
▼Authorized Data Publishers (ADP)
CISA ADP Vulnrichment
Affected Products
Metrics
VersionBase scoreBase severityVector
Metrics Other Info
Impacts
CAPEC IDDescription
Solutions

Configurations

Workarounds

Exploits

Credits

Timeline
EventDate
Replaced By

Rejected Reason

References
HyperlinkResource
Information is not available yet
▼National Vulnerability Database (NVD)
nvd.nist.gov
Source:security-advisories@github.com
Published At:25 Feb, 2025 | 21:15
Updated At:25 Feb, 2025 | 21:15

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.

CISA Catalog
Date AddedDue DateVulnerability NameRequired Action
N/A
Date Added: N/A
Due Date: N/A
Vulnerability Name: N/A
Required Action: N/A
Metrics
TypeVersionBase scoreBase severityVector
Secondary3.18.8HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Type: Secondary
Version: 3.1
Base score: 8.8
Base severity: HIGH
Vector:
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
CPE Matches

Weaknesses
CWE IDTypeSource
CWE-378Primarysecurity-advisories@github.com
CWE-379Primarysecurity-advisories@github.com
CWE ID: CWE-378
Type: Primary
Source: security-advisories@github.com
CWE ID: CWE-379
Type: Primary
Source: security-advisories@github.com
Evaluator Description

Evaluator Impact

Evaluator Solution

Vendor Statements

References
HyperlinkSourceResource
https://en.wikipedia.org/wiki/Fstab#Options_common_to_all_filesystemssecurity-advisories@github.com
N/A
https://en.wikipedia.org/wiki/Sticky_bitsecurity-advisories@github.com
N/A
https://github.com/gradle/gradle/pull/32025security-advisories@github.com
N/A
https://github.com/gradle/gradle/security/advisories/GHSA-465q-w4mf-4f4rsecurity-advisories@github.com
N/A
https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336security-advisories@github.com
N/A
https://github.com/gradle/native-platform/blob/574dfe8d9fb546c990436468d617ab81c140871d/native-platform/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java#L68-L78security-advisories@github.com
N/A
https://github.com/gradle/native-platform/pull/353security-advisories@github.com
N/A
https://github.com/gradle/native-platform/security/advisories/GHSA-2xxp-vw2f-p3x8security-advisories@github.com
N/A
Hyperlink: https://en.wikipedia.org/wiki/Fstab#Options_common_to_all_filesystems
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://en.wikipedia.org/wiki/Sticky_bit
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/gradle/pull/32025
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/gradle/security/advisories/GHSA-465q-w4mf-4f4r
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/native-platform/blob/574dfe8d9fb546c990436468d617ab81c140871d/native-platform/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java#L68-L78
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/native-platform/pull/353
Source: security-advisories@github.com
Resource: N/A
Hyperlink: https://github.com/gradle/native-platform/security/advisories/GHSA-2xxp-vw2f-p3x8
Source: security-advisories@github.com
Resource: N/A

Change History

0
Information is not available yet

Similar CVEs

4Records found

Details not found