Skip to content
OpenAdvisories
High · 8.8 CVE-2021-29428 EUVD-2021-16059

Local privilege escalation through system temporary directory

Published Apr 13, 2021 · Updated Oct 8, 2026 · Assigned by GitHub_M

Description

In Gradle before version 7.0, on Unix-like systems, the system temporary directory can be created with open permissions that allow multiple users to create and delete files within it. Gradle builds could be vulnerable to a local privilege escalation from an attacker quickly deleting and recreating files in the system temporary directory. This vulnerability impacted builds using precompiled script plugins written in Kotlin DSL and tests for Gradle plugins written using ProjectBuilder or TestKit. If you are on Windows or modern versions of macOS, you are not vulnerable. If you are on a Unix-like operating system with the "sticky" bit set on your system temporary directory, you are not vulnerable. The problem has been patched and released with Gradle 7.0. As a workaround, on Unix-like operating systems, ensure that the "sticky" bit is set. This only allows the original user (or root) to delete a file. If you are unable to change the permissions of the system temporary directory, you can move the Java temporary directory by setting the System Property `java.io.tmpdir`. The new path needs to limit permissions to the build user only. For additional details refer to the referenced GitHub Security Advisory.

Affected products

VendorProductAffectedFixed
gradle gradle < 7.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 gradle No fix yet —
Debian 13 gradle No fix yet —
Debian 12 gradle No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 gradle No fix yet —
Ubuntu 26.04 LTS gradle No fix yet —
Ubuntu 25.10 gradle No fix yet —
Ubuntu 24.04 LTS gradle No fix yet —
Ubuntu 22.04 LTS gradle No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS gradle No fix yet —
Ubuntu 16.04 LTS gradle No fix yet —
Ubuntu Pro 18.04 LTS gradle No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP4 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLES 15 SP3 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLES 15 SP2 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP3 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLES for SAP 15 SP2 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLE Real Time 15 SP3 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLE HPC 15 SP3 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SLE HPC 15 SP2 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SUSE Enterprise Storage 7.1 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
SUSE Enterprise Storage 7 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.4 gradle 4.4.1-150200.3.7.1 SUSE-SU-2023:1867-1

Advisories 1

References