CVE-2023-35947 Path traversal vulnerabilities in handling of Tar archives in Gradle
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
Description
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. 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
Upgrade path
12 packages: 1 fixed, 11 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/gradle(Debian 12) | = 4.4.1-18; = 4.4.1-19; = 4.4.1-20; = 4.4.1-21 +13 more | No fix listed | No fix yet |
| debian/gradle(Debian 13) | = 4.4.1-22; = 4.4.1-23; = 4.5.1-1; = 4.6-1 +9 more | No fix listed | No fix yet |
| debian/gradle(Debian 14) | = 4.4.1-22; = 4.4.1-23; = 4.5.1-1; = 4.6-1 +9 more | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 16.04) | = 2.5-3; = 2.7-1; = 2.7-2; = 2.7-3 +2 more | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 20.04) | = 4.4.1-8; = 4.4.1-9; = 4.4.1-10; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 22.04) | = 4.4.1-13; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 24.04) | = 4.4.1-18; = 4.4.1-20; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 25.10) | = 4.4.1-22; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 26.04) | = 4.4.1-22; = 4.4.1-22build1; = 4.4.1-22ubuntu1; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu 26.10) | = 4.4.1-22ubuntu1; = 4.4.1-23; All versions | No fix listed | No fix yet |
| ubuntu/gradle(Ubuntu Pro 18.04) | = 3.2.1-3build2; = 3.2.1-4; = 3.2.1-5; = 3.4.1-4 +5 more | No fix listed | No fix yet |
| gradle | < 7.6.2; = < 7.6.1; = >= 8.0, < 8.2; >= 8.0.0, < 8.2.0 | 7.6.2, 8.2.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/gradle(Debian:12) | All versions | No fix listed |
| debian/gradle(Debian:12) | = 4.10.3-1 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-18 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-19 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-20 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-21 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-22 | No fix listed |
| debian/gradle(Debian:12) | = 4.4.1-23 | No fix listed |
| debian/gradle(Debian:12) | = 4.5.1-1 | No fix listed |
| debian/gradle(Debian:12) | = 4.6-1 | No fix listed |
| debian/gradle(Debian:12) | = 4.6-2 | No fix listed |
| debian/gradle(Debian:12) | = 4.6-3 | No fix listed |
| debian/gradle(Debian:12) | = 4.6-4 | No fix listed |
| debian/gradle(Debian:12) | = 4.6-5 | No fix listed |
| debian/gradle(Debian:12) | = 4.7-1 | No fix listed |
| debian/gradle(Debian:12) | = 4.8-1 | No fix listed |
| debian/gradle(Debian:12) | = 4.9-1 | No fix listed |
| debian/gradle(Debian:13) | All versions | No fix listed |
| debian/gradle(Debian:13) | = 4.10.3-1 | No fix listed |
| debian/gradle(Debian:13) | = 4.4.1-22 | No fix listed |
| debian/gradle(Debian:13) | = 4.4.1-23 | No fix listed |
| debian/gradle(Debian:13) | = 4.5.1-1 | No fix listed |
| debian/gradle(Debian:13) | = 4.6-1 | No fix listed |
| debian/gradle(Debian:13) | = 4.6-2 | No fix listed |
| debian/gradle(Debian:13) | = 4.6-3 | No fix listed |
Show 55 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/gradle(Debian:13) | = 4.6-4 | No fix listed |
| debian/gradle(Debian:13) | = 4.6-5 | No fix listed |
| debian/gradle(Debian:13) | = 4.7-1 | No fix listed |
| debian/gradle(Debian:13) | = 4.8-1 | No fix listed |
| debian/gradle(Debian:13) | = 4.9-1 | No fix listed |
| debian/gradle(Debian:14) | All versions | No fix listed |
| debian/gradle(Debian:14) | = 4.10.3-1 | No fix listed |
| debian/gradle(Debian:14) | = 4.4.1-22 | No fix listed |
| debian/gradle(Debian:14) | = 4.4.1-23 | No fix listed |
| debian/gradle(Debian:14) | = 4.5.1-1 | No fix listed |
| debian/gradle(Debian:14) | = 4.6-1 | No fix listed |
| debian/gradle(Debian:14) | = 4.6-2 | No fix listed |
| debian/gradle(Debian:14) | = 4.6-3 | No fix listed |
| debian/gradle(Debian:14) | = 4.6-4 | No fix listed |
| debian/gradle(Debian:14) | = 4.6-5 | No fix listed |
| debian/gradle(Debian:14) | = 4.7-1 | No fix listed |
| debian/gradle(Debian:14) | = 4.8-1 | No fix listed |
| debian/gradle(Debian:14) | = 4.9-1 | No fix listed |
| gradle | = < 7.6.1 | No fix listed |
| gradle | = >= 8.0, < 8.2 | No fix listed |
| ubuntu/gradle(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:26.10) | All versions | No fix listed |
| gradle | < 7.6.2 | 7.6.2 |
| gradle | >= 8.0.0, < 8.2.0 | 8.2.0 |
| ubuntu/gradle(Ubuntu:16.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:16.04) | = 2.5-3 | No fix listed |
| ubuntu/gradle(Ubuntu:16.04) | = 2.7-1 | No fix listed |
| ubuntu/gradle(Ubuntu:16.04) | = 2.7-2 | No fix listed |
| ubuntu/gradle(Ubuntu:16.04) | = 2.7-3 | No fix listed |
| ubuntu/gradle(Ubuntu:16.04) | = 2.10-1 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.2.1-3build2 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.2.1-4 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.2.1-5 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.4.1-4 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.4.1-6 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 3.4.1-7ubuntu1 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 4.4.1-5ubuntu2~18.04 | No fix listed |
| ubuntu/gradle(Ubuntu:Pro:18.04) | = 4.4.1-5ubuntu2~18.04+esm1 | No fix listed |
| ubuntu/gradle(Ubuntu:20.04) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:20.04) | = 4.4.1-8 | No fix listed |
| ubuntu/gradle(Ubuntu:20.04) | = 4.4.1-9 | No fix listed |
| ubuntu/gradle(Ubuntu:20.04) | = 4.4.1-10 | No fix listed |
| ubuntu/gradle(Ubuntu:22.04) | = 4.4.1-13 | No fix listed |
| ubuntu/gradle(Ubuntu:24.04) | = 4.4.1-18 | No fix listed |
| ubuntu/gradle(Ubuntu:24.04) | = 4.4.1-20 | No fix listed |
| ubuntu/gradle(Ubuntu:25.10) | All versions | No fix listed |
| ubuntu/gradle(Ubuntu:25.10) | = 4.4.1-22 | No fix listed |
| ubuntu/gradle(Ubuntu:26.10) | = 4.4.1-22ubuntu1 | No fix listed |
| ubuntu/gradle(Ubuntu:26.10) | = 4.4.1-23 | No fix listed |
| ubuntu/gradle(Ubuntu:26.04) | = 4.4.1-22 | No fix listed |
| ubuntu/gradle(Ubuntu:26.04) | = 4.4.1-22build1 | No fix listed |
| ubuntu/gradle(Ubuntu:26.04) | = 4.4.1-22ubuntu1 | No fix listed |
References
- Debian Security Tracker CVE-2023-35947 vendor-advisory
- https://github.com/gradle/gradle/security/advisories/GHSA-84mw-qh6q-v842 issue-tracking vendor-advisory
- https://github.com/gradle/gradle/commit/1096b309520a8c315e3b6109a6526de4eabcb879 issue-tracking patch
- https://github.com/gradle/gradle/commit/2e5c34d57d0c0b7f0e8b039a192b91e5c8249d91 issue-tracking patch
- security.netapp.com third-party-advisory
- Ubuntu CVE tracker issue-tracking vendor-advisory
- www.cve.org issue-tracking
- bugs.debian.org issue-tracking