Local privilege escalation through system temporary directory
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 3 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| gradle | gradle | before 7.0 | 7.0 | Patch available | CNA |
- gradle Vendorgradle Affected before 7.0 Fixed in 7.0 Patch available CNA
Remediation
- Fix · CNA gradle (gradle) Fixed in 7.0
Red Hat 1 advisory
- RHSA-2022:4623 Released 2022-05-18 · Red Hat rating ModerateRed Hat build of Quarkus 2.7.5 release and security update
- Red Hat build of Quarkus 2.7.5
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Integration Camel K 1 | Affected | No fix yet: Fix deferred |
| Red Hat Integration Camel Quarkus 1 | Affected | No fix yet |
| Red Hat build of Quarkus | Affected | No fix yet |
| Red Hat build of Quarkus 2.7.5 | Fixed | RHSA-2022:4623 |
Not affected: 4 products
- Red Hat Fuse 7
- Red Hat JBoss Enterprise Application Platform 7
- Red Hat JBoss Enterprise Application Platform Expansion Pack
- streams for Apache Kafka
Timeline
- 2026-10-02 Threatist record created from CVE-2021-29428
- 2026-10-08 CISA SSVC decision points changed
- 2026-10-09 Priority changed: LOW → MEDIUM
References
More Gradle vulnerabilities
- TI-2016-05320 ObjectSocketWrapper.java in Gradle 2.12 allows remote attackers to execute arbitrary code… CVSS 3.0CRITICAL 9.8
- TI-2020-09639 Injection in Apache Ant CVSS 3.1HIGH 7.5
- TI-2019-11237 The HTTP client in Gradle before 5.6 sends authentication credentials originally destined… CVSS 3.1CRITICAL 9.8
- TI-2021-12419 Arbitrary code execution via specially crafted environment variables CVSS 3.1HIGH 7.5
- TI-2023-11286 Gradle usage of long IDs for PGP keys opens potential for collision attacks CVSS 3.1CRITICAL 9.8
- TI-2022-07682 Dependency verification bypass in Gradle CVSS 3.1HIGH 7.5
Sources
- CVE-2021-29428 · CVE Program
- CVE-2021-29428 · NVD
- FIRST EPSS
- CVE-2021-29428 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences