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-35946

CVE-2023-35946: Gradle Path Traversal Vulnerability

CVE-2023-35946 is a path traversal vulnerability in Gradle that allows attackers to write files outside the dependency cache. This post covers the technical details, affected versions, impact, and mitigation.

Published: January 28, 2026

CVE-2023-35946 Overview

CVE-2023-35946 is a path traversal vulnerability affecting Gradle, a widely-used build automation tool that supports multi-language development. The vulnerability exists in how Gradle writes dependencies into its dependency cache, using dependency coordinates to compute file locations. An attacker with specially crafted dependency coordinates can manipulate Gradle to write files to unintended locations outside the dependency cache or overwrite existing files within the cache.

Critical Impact

This vulnerability enables dependency cache poisoning and arbitrary file overwrites on the filesystem where the Gradle process has write permissions, potentially leading to supply chain attacks or system compromise.

Affected Products

  • Gradle versions prior to 7.6.2
  • Gradle versions prior to 8.2
  • All Gradle installations using dependency caching without verification

Discovery Timeline

  • 2023-06-30 - CVE-2023-35946 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-35946

Vulnerability Analysis

This path traversal vulnerability (CWE-22) affects Gradle's dependency caching mechanism. When Gradle processes dependencies, it calculates the storage location in its local cache based on the dependency's coordinates (group ID, artifact ID, and version). The vulnerability arises from insufficient validation of these coordinates, allowing path traversal sequences to escape the intended cache directory structure.

Successful exploitation requires the attacker to either control a dependency repository used by the Gradle build or have the ability to modify the build's configuration directly. While this represents a significant barrier to exploitation, compromised or malicious repositories could leverage this flaw to poison development environments at scale.

The impact is primarily on integrity, as attackers can overwrite files but cannot directly read sensitive data through this vulnerability alone. However, overwriting critical build files, configuration scripts, or other sensitive resources could lead to code execution or further compromise of the build pipeline.

Root Cause

The root cause lies in Gradle's failure to properly sanitize dependency coordinates before using them to construct file paths in the dependency cache. When a dependency is downloaded, Gradle uses its coordinates (such as group:artifact:version) to determine where to store the cached files. Without proper validation, coordinates containing path traversal elements like ../ can manipulate the resulting file path, causing files to be written outside the designated cache directory.

The vulnerability specifically affects the file path computation logic that concatenates dependency coordinate components without checking for directory traversal sequences or normalizing the resulting paths.

Attack Vector

Exploitation of this vulnerability requires local access and involves the following attack scenario:

  1. An attacker gains control over a dependency repository that a target Gradle build references, or modifies the build configuration to point to a malicious repository
  2. The attacker publishes a dependency with specially crafted coordinates containing path traversal sequences (e.g., ../../../etc/)
  3. When a developer or CI/CD pipeline executes a Gradle build, the malicious dependency is fetched
  4. Gradle's caching mechanism writes the dependency files to an attacker-controlled location outside the cache directory
  5. The attacker achieves arbitrary file write capability within the Gradle process's permissions

The attack pattern involves crafting malicious dependency coordinates that include directory traversal elements. When Gradle processes these coordinates, the path computation logic fails to sanitize the input, resulting in file writes to locations outside the intended cache directory.

For detailed technical information about the exploitation mechanism, refer to the GitHub Security Advisory GHSA-2h6c-rv6q-494v.

Detection Methods for CVE-2023-35946

Indicators of Compromise

  • Unexpected files appearing outside the Gradle dependency cache directory (typically ~/.gradle/caches/modules-2/files-2.1/)
  • Dependencies with unusual characters or path traversal sequences in their coordinates within build configuration files
  • Modifications to critical system or build files that coincide with Gradle build executions
  • Build logs showing dependencies with suspicious naming patterns containing .. sequences

Detection Strategies

  • Implement file integrity monitoring on directories adjacent to or above the Gradle cache directory
  • Audit build.gradle and settings.gradle files for references to untrusted or suspicious dependency repositories
  • Review Gradle build logs for dependencies with anomalous coordinate patterns
  • Monitor for unexpected file writes during Gradle build processes using endpoint detection tools

Monitoring Recommendations

  • Enable SentinelOne's file integrity monitoring to detect writes outside expected Gradle cache locations
  • Configure alerts for Gradle processes writing to sensitive system directories
  • Implement centralized logging for all Gradle build activities in CI/CD environments
  • Establish baseline behavior for Gradle's file operations and alert on deviations

How to Mitigate CVE-2023-35946

Immediate Actions Required

  • Upgrade Gradle to version 7.6.2 or 8.2 or later immediately
  • Enable Gradle's dependency verification feature if upgrading is not immediately possible
  • Audit all configured dependency repositories for trustworthiness
  • Review recent builds for any signs of compromise or unexpected file modifications

Patch Information

Gradle has released patches in versions 7.6.2 and 8.2 that address this vulnerability. The fix implements validation to refuse caching dependencies that have path traversal elements in their dependency coordinates. Organizations should upgrade to these patched versions as soon as possible.

Security patches are available via the following commits:

  • Gradle Commit 859eae2b2acf751ae7db3c9ffefe275aa5da0d5d
  • Gradle Commit b07e528feb3a5ffa66bdcc358549edd73e4c8a12

Workarounds

  • Enable Gradle dependency verification to make exploitation more difficult by validating dependency checksums and signatures
  • Restrict Gradle builds to only use trusted, internal dependency repositories
  • Implement network-level controls to prevent builds from accessing unauthorized external repositories
  • Run Gradle builds with minimal filesystem permissions to limit the impact of potential file overwrites
bash
# Enable dependency verification in gradle/verification-metadata.xml
# Create this file to enforce checksum verification
gradle --write-verification-metadata sha256,sha512 help
# Review and commit the generated verification-metadata.xml file

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

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.11%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • NetApp Security Advisory ntap-20230731-0003
  • Vendor Resources
  • Gradle User Guide on Dependency Verification

  • Gradle Commit Overview

  • Gradle Commit Overview

  • GitHub Security Advisory GHSA-2h6c-rv6q-494v
  • Related CVEs
  • CVE-2023-35947: 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