The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-27148

CVE-2025-27148: Gradle Privilege Escalation Vulnerability

CVE-2025-27148 is a local privilege escalation vulnerability in Gradle's native-platform library affecting temporary directory handling. This post covers the technical details, affected versions, exploit risks, and mitigation steps.

Updated: January 22, 2026

CVE-2025-27148 Overview

CVE-2025-27148 is a local privilege escalation vulnerability affecting Gradle's native-platform tool, which provides Java bindings for native APIs. On Unix-like systems, the library initialization process creates files in the system temporary directory with open permissions, allowing any user to create and delete files. An attacker with local access can exploit a race condition by rapidly deleting and recreating files in the temporary directory during Gradle build initialization, potentially achieving privilege escalation.

Critical Impact

Local attackers can escalate privileges on vulnerable Unix-like systems by exploiting race conditions in Gradle's native library initialization, potentially compromising build infrastructure and development environments.

Affected Products

  • Gradle 8.12 (exact version only)
  • net.rubygrapefruit:native-platform versions prior to 0.22-milestone-28
  • Unix-like operating systems without sticky bit set on /tmp

Discovery Timeline

  • 2025-02-25 - CVE CVE-2025-27148 published to NVD
  • 2025-02-25 - Last updated in NVD database

Technical Details for CVE-2025-27148

Vulnerability Analysis

This vulnerability stems from insecure temporary file handling in Gradle's native-platform library (CWE-378: Creation of Temporary File With Insecure Permissions). When the Native.get(Class<>) method is called without first calling Native.init(File) with a non-null working file path argument, the library initializes itself using the system temporary directory. The vulnerable code path exists in NativeLibraryLocator.java at lines 68 through 78.

The attack requires local access to the system and leverages a Time-of-Check Time-of-Use (TOCTOU) race condition. An attacker monitoring the temporary directory can quickly delete legitimate library files and replace them with malicious versions before Gradle loads them. Because the temporary directory typically has world-writable permissions (unless the sticky bit is set), any local user can manipulate these files.

Windows users and users of modern macOS versions are not vulnerable due to different temporary directory permission models. Additionally, Unix-like systems with the sticky bit set on /tmp or with /tmp mounted as noexec are protected against this attack vector.

Root Cause

The root cause lies in the native-platform library's fallback behavior when proper initialization is not performed. In versions prior to 0.22-milestone-28, if Native.init(File) was not called with a safe, user-controlled path before Native.get(Class<>), the library would default to using the system temporary directory for storing native binaries. This directory is typically world-writable on Unix-like systems, creating an opportunity for local privilege escalation through file manipulation.

Attack Vector

The attack exploits the local access vector by targeting the temporary directory during Gradle build execution. An attacker must:

  1. Monitor the system temporary directory for Gradle native library files being created
  2. Quickly delete the legitimate native library file after creation
  3. Replace it with a malicious library containing attacker-controlled code
  4. Wait for Gradle to load the malicious library with the build user's privileges

The attack window is the brief period between file creation and library loading. Success depends on winning the race condition, which may require multiple attempts. The vulnerability allows code execution with the privileges of the user running the Gradle build, which in CI/CD environments could be highly privileged service accounts.

Detection Methods for CVE-2025-27148

Indicators of Compromise

  • Unexpected file creation or deletion patterns in /tmp during Gradle build processes
  • Modified or replaced native library files in the system temporary directory
  • Anomalous process execution spawned from Gradle build processes
  • Suspicious file access patterns from non-build user accounts targeting Gradle temporary files

Detection Strategies

  • Monitor file system activity in /tmp and java.io.tmpdir locations for rapid create/delete cycles during Gradle executions
  • Audit Gradle version usage across development and CI/CD systems to identify instances of version 8.12
  • Implement file integrity monitoring on temporary directories used by build processes
  • Review dependency trees for usage of net.rubygrapefruit:native-platform versions prior to 0.22-milestone-28

Monitoring Recommendations

  • Enable detailed logging for file operations in temporary directories during build processes
  • Configure security tools to alert on privilege escalation attempts from build tool processes
  • Monitor for unusual user account activity accessing build system temporary files
  • Implement baseline monitoring for Gradle process behavior to detect anomalous library loading

How to Mitigate CVE-2025-27148

Immediate Actions Required

  • Upgrade Gradle to version 8.12.1 or 8.13 immediately
  • Upgrade net.rubygrapefruit:native-platform to version 0.22-milestone-28 or later
  • Verify that the sticky bit is set on /tmp on all Unix-like build systems
  • Audit CI/CD pipelines and development machines for vulnerable Gradle versions

Patch Information

The vulnerability has been addressed in multiple releases. Gradle 8.12.1 specifically fixes this issue, while Gradle 8.13 upgrades to a patched version of the native-platform library that no longer contains the vulnerability. The underlying library fix is available in net.rubygrapefruit:native-platform version 0.22-milestone-28, which makes initialization mandatory and no longer uses the system temporary directory by default.

For detailed information about the fixes, see GitHub Pull Request #32025 for the Gradle fix and GitHub Pull Request #353 for the native-platform library fix. Security advisories are available at GitHub Security Advisory GHSA-89qm and GitHub Security Advisory GHSA-2xxp.

Workarounds

  • Set the sticky bit on the system temporary directory to restrict file deletion to file owners only
  • Mount /tmp with the noexec option to prevent execution of files from the temporary directory (note: this prevents Gradle 8.12 from starting)
  • Redirect the Java temporary directory by setting the java.io.tmpdir system property to a secure location with restricted permissions
  • Ensure proper initialization of the native-platform library using Native.init(File) with a safe, user-controlled path before any Native.get(Class<>) calls
bash
# Set sticky bit on temporary directory
chmod +t /tmp

# Or redirect Java temp directory to secure location
mkdir -p /secure/gradle-tmp
chmod 700 /secure/gradle-tmp
export JAVA_OPTS="-Djava.io.tmpdir=/secure/gradle-tmp"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechGradle

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-378
  • Technical References
  • Wikipedia Fstab Options

  • Wikipedia Sticky Bit

  • GitHub Pull Request #32025

  • GitHub Security Advisory GHSA-465q

  • GitHub Security Advisory GHSA-89qm

  • GitHub NativeLibraryLocator Code

  • GitHub Pull Request #353

  • GitHub Security Advisory GHSA-2xxp
  • Related CVEs
  • CVE-2021-29428: Gradle Privilege Escalation Vulnerability

  • CVE-2026-25063: gradle-completion RCE Vulnerability

  • CVE-2026-22865: Gradle Build Tool DOS Vulnerability

  • CVE-2026-22816: Gradle Build Automation RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English