# CVE-2023-35947: Path traversal vulnerabilities in handling of Tar archives in Gradle

Status: published. Published: 2023-06-30. Updated: 2026-11-02.

Gradle is a build tool with a focus on build automation and support for multi-language development. In affected versions when unpacking Tar archives, Gradle did not check that files could be written outside of the unpack location. This could lead to important files being overwritten anywhere the Gradle process has write permissions. For a build reading Tar entries from a Tar archive, this issue could allow Gradle to disclose information from sensitive files through an arbitrary file read. To exploit this behavior, an attacker needs to either control the source of an archive already used by the build or modify the build to interact with a malicious archive. It is unlikely that this would go unnoticed. A fix has been released in Gradle 7.6.2 and 8.2 to protect against this vulnerability. Starting from these versions, Gradle will refuse to handle Tar archives which contain path traversal elements in a Tar entry name. Users are advised to upgrade. There are no known workarounds for this vulnerability.



### Impact

This is a path traversal vulnerability when Gradle deals with Tar archives, often referenced as TarSlip, a variant of ZipSlip.

* When unpacking Tar archives, Gradle did not check that files could be written outside of the unpack location. This could lead to important files being overwritten anywhere the Gradle process has write permissions.
* For a build reading Tar entries from a Tar archive, this issue could allow Gradle to disclose information from sensitive files through an arbitrary file read.

To exploit this behavior, an attacker needs to either control the source of an archive already used by the build or modify the build to interact with a malicious archive. It is unlikely that this would go unnoticed.

Gradle uses Tar archives for its [Build Cache](https://docs.gradle.org/current/userguide/build_cache.html). These archives are safe when created by Gradle. But if an attacker had control of a remote build cache server, they could inject malicious build cache entries that leverage this vulnerability. This attack vector could also be exploited if a man-in-the-middle can be performed between the remote cache and the build.

### Patches

A fix has been released in Gradle 7.6.2 and 8.2 to protect against this vulnerability. Starting from these versions, Gradle will refuse to handle Tar archives which contain path traversal elements in a Tar entry name.

It is recommended that users upgrade to a patched version.

### Workarounds

There is no workaround.

* If your build deals with Tar archives that you do not fully trust, you need to inspect them to confirm they do not attempt to leverage this vulnerability.
* If you use the Gradle remote build cache, make sure only trusted parties have write access to it and that connections to the remote cache are properly secured.

### References

* [CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')](https://cwe.mitre.org/data/definitions/22.html)
* [Gradle Build Cache](https://docs.gradle.org/current/userguide/build_cache.html)
* [ZipSlip](https://security.snyk.io/research/zip-slip-vulnerability)

## Remediation

- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: security-advisories@github.com) — https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: security-advisories@github.com) — https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: af854a3a-2127-422b-91ae-364da2661108) — https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: af854a3a-2127-422b-91ae-364da2661108) — https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91

## Affected products and versions

- gradle / gradle: < 7.6.1 (affected); >= 8.0, < 8.2 (affected). Source: CNA: GitHub_M

## NVD configuration conditions

Affected CPE matches depend on the following AND/OR and negation conditions:

```json
[
  {
    "negate": false,
    "nodes": [
      {
        "cpeMatch": [
          {
            "criteria": "cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*",
            "versionEndExcluding": "7.6.2",
            "vulnerable": true
          },
          {
            "criteria": "cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*",
            "versionEndExcluding": "8.2.0",
            "versionStartIncluding": "8.0.0",
            "vulnerable": true
          }
        ],
        "negate": false,
        "operator": "OR"
      }
    ],
    "operator": "OR"
  }
]
```

## Severity and prioritization

- CVSS 3.1: 6.9 (medium); CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L; source: CNA: GitHub_M

- CVSS 3.1: 8.1 (high); CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H; source: NVD: nvd@nist.gov

- CVSS 3.1: 6.9 (medium); CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L; source: NVD: security-advisories@github.com

- CISA KEV: No listing in collected sources

- EPSS: 0.53% as of 2026-11-02; percentile 44.73%

- SSVC: exploitation none; automatable no; technical impact partial; source ADP: CISA-ADP

- Weaknesses: CWE-22

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://github.com/gradle/gradle/security/advisories/GHSA-84mw-qh6q-v842 (CNA: GitHub_M; x_refsource_CONFIRM)

- https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91 (CNA: GitHub_M; x_refsource_MISC)

- https://security.netapp.com/advisory/ntap-20230803-0007/ (CNA: GitHub_M)

- https://github.com/gradle/gradle/security/advisories/GHSA-84mw-qh6q-v842 (ADP: CVE; x_refsource_CONFIRM, x_transferred)

- https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879 (ADP: CVE; x_refsource_MISC, x_transferred)

- https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91 (ADP: CVE; x_refsource_MISC, x_transferred)

- https://security.netapp.com/advisory/ntap-20230803-0007/ (ADP: CVE; x_transferred)

- https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879 (security-advisories@github.com; Patch)

- https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91 (security-advisories@github.com; Patch)

- https://github.com/gradle/gradle/security/advisories/GHSA-84mw-qh6q-v842 (security-advisories@github.com; Vendor Advisory)

- https://security.netapp.com/advisory/ntap-20230803-0007/ (security-advisories@github.com; Third Party Advisory)

- https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879 (af854a3a-2127-422b-91ae-364da2661108; Patch)

- https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91 (af854a3a-2127-422b-91ae-364da2661108; Patch)

- https://github.com/gradle/gradle/security/advisories/GHSA-84mw-qh6q-v842 (af854a3a-2127-422b-91ae-364da2661108; Vendor Advisory)

- https://security.netapp.com/advisory/ntap-20230803-0007/ (af854a3a-2127-422b-91ae-364da2661108; Third Party Advisory)

## Provenance

- CNA: GitHub_M: https://www.cve.org/CVERecord?id=CVE-2023-35947; retrieved 2026-11-02; source updated 2026-11-02

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-35947; retrieved 2026-11-03; source updated 2026-11-02

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2023-35947; retrieved 2026-11-02; source updated Not reported

Revision: 9aaef79f526653db991872f07cec48ebe0256951acb9cd0436de29af307f54da

Canonical: https://y2.dev/cve/CVE-2023-35947

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.