Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2023-35947

CVE-2023-35947: Gradle Path Traversal Vulnerability

CVE-2023-35947 is a path traversal vulnerability in Gradle that allows attackers to overwrite files or read sensitive data when unpacking Tar archives. This article covers the technical details, affected versions, and mitigations.

Published: February 11, 2026

CVE-2023-35947 Overview

CVE-2023-35947 is a path traversal vulnerability affecting Gradle, a widely-used build automation tool supporting multi-language development. This vulnerability, commonly known as TarSlip (a variant of the well-known ZipSlip attack), occurs when Gradle unpacks Tar archives without properly validating that extracted files remain within the intended destination directory.

When processing malicious Tar archives containing path traversal sequences (such as ../), Gradle fails to validate entry names, allowing attackers to write files to arbitrary locations on the filesystem where the Gradle process has write permissions. This can lead to critical file overwrites, arbitrary file reads, and potential code execution through the compromise of build cache infrastructure.

Critical Impact

Attackers can overwrite critical system or application files, disclose sensitive information through arbitrary file reads, and potentially compromise CI/CD pipelines by injecting malicious entries into Gradle's remote build cache.

Affected Products

  • Gradle versions prior to 7.6.2
  • Gradle versions 8.0 through 8.1.x (prior to 8.2)
  • Systems utilizing Gradle Build Cache with untrusted remote cache servers

Discovery Timeline

  • 2023-06-30 - CVE-2023-35947 published to NVD
  • 2025-04-11 - Last updated in NVD database

Technical Details for CVE-2023-35947

Vulnerability Analysis

This path traversal vulnerability (CWE-22) stems from Gradle's insufficient validation of Tar archive entry names during extraction operations. When Gradle processes Tar archives—whether from direct file operations or through its Build Cache mechanism—it does not verify that the resolved file paths remain within the intended extraction directory.

The vulnerability can be exploited through two primary attack surfaces:

  1. Direct Tar Archive Processing: If a build script extracts Tar archives from untrusted sources, malicious entries with path traversal sequences can escape the target directory.

  2. Build Cache Poisoning: Gradle's Build Cache uses Tar archives internally. An attacker with write access to a remote build cache server, or one capable of performing a man-in-the-middle attack between the cache and the build, can inject malicious cache entries containing path traversal payloads.

Root Cause

The root cause lies in Gradle's AbstractArchiveFileTreeElement and TarFileTree classes, which did not incorporate path traversal detection when resolving file destinations during Tar extraction. The entry names from Tar archives were used directly without sanitization, allowing relative path components like ../ to traverse outside the intended extraction directory.

Attack Vector

An attacker must either control or manipulate a Tar archive that Gradle processes during a build. This can occur through:

  • Compromising an upstream dependency or artifact server that provides Tar archives
  • Gaining write access to a remote Gradle Build Cache server
  • Performing a man-in-the-middle attack on unencrypted connections to remote build caches
  • Social engineering a developer to use a malicious Tar archive in their build

The following patches from the Gradle Security Advisory demonstrate the fix implementation:

java
 import org.gradle.api.internal.file.AbstractFileTreeElement;
 import org.gradle.internal.file.Chmod;
 import org.gradle.util.internal.GFileUtils;
+import org.gradle.util.internal.ZipSlip;
 
 import java.io.File;
 import java.util.concurrent.atomic.AtomicBoolean;

Source: GitHub Commit 1096b309

The fix introduces a ZipSlip helper class to validate archive entry names:

java
         }
 
         @Override
-        protected String safeEntryName() {
+        protected String getEntryName() {
             return entry.getName();
         }

Source: GitHub Commit 1096b309

The build cache packaging module was also updated to incorporate path traversal protection:

text
     api(project(":files"))
 
     implementation(project(":base-annotations"))
-
+    implementation(project(":wrapper-shared")) {
+        because("We need to access the ZipSlip helper class")
+    }
     implementation(libs.guava)
     implementation(libs.commonsCompress)
     implementation(libs.commonsIo)

Source: GitHub Commit 2e5c34d5

Detection Methods for CVE-2023-35947

Indicators of Compromise

  • Unexpected file modifications outside of project directories during Gradle builds
  • Files appearing in system directories (/etc/, /usr/, C:\Windows\) coinciding with build operations
  • Build cache entries containing suspicious Tar archive entry names with ../ sequences
  • Anomalous network traffic to remote build cache servers from untrusted sources

Detection Strategies

  • Monitor Gradle build logs for unusual file write operations outside expected project paths
  • Implement file integrity monitoring (FIM) on critical system files and directories during CI/CD builds
  • Audit remote build cache access logs for unauthorized write operations or suspicious patterns
  • Scan Tar archives processed by builds for entries containing path traversal sequences before extraction

Monitoring Recommendations

  • Deploy SentinelOne agents on build servers to detect and alert on anomalous file system activity during build processes
  • Enable verbose logging for Gradle builds in CI/CD pipelines to capture detailed file operation records
  • Implement network segmentation and monitoring for build cache infrastructure
  • Use SentinelOne's behavioral AI to identify unusual process behavior patterns indicative of path traversal exploitation

How to Mitigate CVE-2023-35947

Immediate Actions Required

  • Upgrade Gradle to version 7.6.2 or later for the 7.x branch, or version 8.2 or later for the 8.x branch
  • Audit all Tar archives used in build processes for path traversal sequences before upgrading
  • Restrict write access to remote build cache servers to trusted parties only
  • Ensure all connections to remote build caches use TLS/HTTPS to prevent man-in-the-middle attacks
  • Review CI/CD pipeline configurations for builds that process Tar archives from external sources

Patch Information

Gradle has released security patches in versions 7.6.2 and 8.2. The fix implements validation that rejects Tar archives containing path traversal elements in entry names. The patches introduce a ZipSlip helper class that checks for directory traversal attempts before allowing file extraction.

Relevant security commits:

  • Commit 1096b309
  • Commit 2e5c34d5

For additional details, refer to the Gradle Security Advisory GHSA-84mw-qh6q-v842 and the NetApp Security Advisory.

Workarounds

  • There is no official workaround for this vulnerability; upgrading is the recommended remediation
  • If upgrading is not immediately possible, manually inspect all Tar archives used in builds to verify they do not contain path traversal sequences
  • Disable remote build cache functionality until the upgrade can be applied if cache integrity cannot be guaranteed
  • Implement network-level controls to ensure only authenticated and encrypted connections to build cache servers
bash
# Check current Gradle version
./gradlew --version

# Upgrade Gradle wrapper to patched version (7.6.2 or 8.2+)
./gradlew wrapper --gradle-version 8.2

# Verify build cache remote connection uses HTTPS
# In settings.gradle or settings.gradle.kts:
# buildCache {
#     remote(HttpBuildCache) {
#         url = 'https://your-secure-cache-server/cache/'
#         credentials {
#             username = System.getenv('BUILD_CACHE_USER')
#             password = System.getenv('BUILD_CACHE_PASSWORD')
#         }
#     }
# }

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechGradle

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.14%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Technical References
  • NetApp Security Advisory
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2023-35946: Gradle Path Traversal 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