CVE-2021-29428Local privilege escalation through system temporary directory
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.
What to do
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | gradle | Fix pending | UBUNTU-CVE-2021-29428 | |
| Ubuntu 26.04 | gradle | Fix pending | UBUNTU-CVE-2021-29428 | |
| Ubuntu 25.10 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-29428 | |
| Ubuntu 24.04 | gradle | Fix pending | UBUNTU-CVE-2021-29428 | |
| Ubuntu 22.04 | gradle | Fix pending | UBUNTU-CVE-2021-29428 | |
| Ubuntu 20.04 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-29428 | |
| Ubuntu 18.04 | gradle | Fix pending | UBUNTU-CVE-2021-29428 | |
| Ubuntu 16.04 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-29428 | |
| Ubuntu 14.04 | gradle | Will not fix Ubuntu decided not to fix this in this release | ||
| Debian 14 | gradle | Fix pending | DEBIAN-CVE-2021-29428 | |
| Debian 13 | gradle | Fix pending | DEBIAN-CVE-2021-29428 | |
| Debian 12 | gradle | Fix pending | DEBIAN-CVE-2021-29428 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- gradle: affected: < 7.0
References
- https://docs.gradle.org/7.0/release-notes.html#security-advisories
- https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336
- https://github.com/gradle/gradle/pull/15654
- https://github.com/gradle/gradle/pull/15240
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.