A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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, and mitigation strategies.

Updated: May 15, 2026

CVE-2023-35946 Overview

CVE-2023-35946 is a path traversal vulnerability in Gradle, a build automation tool used across multi-language development projects. When Gradle writes a dependency into its dependency cache, it derives the destination file path from the dependency's coordinates. Specially crafted coordinates can force Gradle to write files outside the cache or overwrite existing files within it. The flaw is tracked as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Exploitation requires an attacker to control a dependency repository consumed by the build or to modify the build configuration. Successful abuse enables dependency cache poisoning or overwriting of files where the Gradle process has write permissions.

Critical Impact

Attackers with control over a dependency source can write arbitrary files on the build host, poisoning the dependency cache and corrupting integrity of downstream builds.

Affected Products

  • Gradle versions prior to 7.6.2
  • Gradle 8.x versions prior to 8.2
  • Build environments consuming untrusted dependency repositories

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

Gradle constructs filesystem paths inside its dependency cache directly from dependency coordinates such as group, artifact, and version. The code paths responsible for caching did not validate these coordinate components for path traversal sequences. An attacker controlling the coordinates can embed ../ segments that escape the intended cache directory.

The result is a write-primitive constrained by the permissions of the Gradle process. On developer workstations and CI runners, that process typically holds write access to source trees, build artifacts, and shell startup files. The integrity impact is high while confidentiality and availability are not directly affected.

Root Cause

The root cause is missing input sanitization on dependency coordinates used to compute cache file destinations. Gradle treated coordinate strings as trusted identifiers rather than untrusted input. The fix in commits 859eae2 and b07e528 causes Gradle to refuse to cache dependencies whose coordinates contain path traversal elements.

Attack Vector

An attacker must either control a dependency repository the build resolves against or have the ability to alter the build's configuration. The attacker publishes a malicious artifact whose coordinates include traversal sequences. When Gradle resolves and caches the dependency, the manipulated path causes the artifact bytes to be written to an attacker-chosen location. Targets include cache entries for legitimate libraries, shell configuration files, or scripts executed by CI runners. The GitHub Security Advisory GHSA-2h6c-rv6q-494v documents the issue in detail.

// No verified public proof-of-concept code is available for CVE-2023-35946.
// Refer to the upstream advisory for technical details:
// https://github.com/gradle/gradle/security/advisories/GHSA-2h6c-rv6q-494v

Detection Methods for CVE-2023-35946

Indicators of Compromise

  • Unexpected files appearing outside the ~/.gradle/caches/modules-2/ directory after dependency resolution
  • Modifications to legitimate cached artifacts whose checksums no longer match upstream repository values
  • Build log entries showing dependency coordinates containing .., /, or \ characters
  • Use of unfamiliar or non-corporate Maven or Ivy repositories in build.gradle or settings.gradle

Detection Strategies

  • Audit build.gradle, settings.gradle, and init.gradle files for repository declarations pointing to untrusted hosts
  • Compare cached artifact hashes against authoritative upstream checksums to detect cache poisoning
  • Inspect Gradle wrapper scripts and version pinning to confirm builds run on 7.6.2, 8.2, or later

Monitoring Recommendations

  • Enable filesystem auditing on CI build agents for writes outside the configured Gradle cache directory
  • Log and alert on outbound Gradle traffic to dependency repositories not on an approved allowlist
  • Track changes to build configuration files in source control with mandatory code review

How to Mitigate CVE-2023-35946

Immediate Actions Required

  • Upgrade Gradle to version 7.6.2, 8.2, or later across all developer workstations and CI/CD runners
  • Enable Gradle dependency verification to enforce checksum and signature validation
  • Restrict repository declarations to vetted internal proxies and trusted public registries
  • Inventory existing Gradle caches and rebuild from clean state if cache poisoning is suspected

Patch Information

Gradle released fixes in versions 7.6.2 and 8.2. The patched code rejects dependency coordinates containing path traversal elements before any cache write occurs. Review the upstream commits 859eae2 and b07e528, and the GitHub Security Advisory GHSA-2h6c-rv6q-494v. NetApp published downstream guidance in NTAP-20230731-0003.

Workarounds

  • Enable dependency verification to make exploitation significantly more difficult on unpatched versions
  • Limit repositories {} blocks to internal artifact repositories such as Artifactory or Nexus that enforce coordinate validation
  • Run builds under least-privileged accounts to reduce the blast radius of an arbitrary file write
bash
# Enforce dependency verification in gradle/verification-metadata.xml
./gradlew --write-verification-metadata sha256 help

# Pin Gradle wrapper to a patched release
./gradlew wrapper --gradle-version 8.2

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 Dependency Verification Guide

  • Gradle Commit #859eae2

  • Gradle Commit #b07e528

  • 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 Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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