CVE-2021-29428
Local privilege escalation through system temporary directory
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
1Exploited in Wild
-Decision
Descriptions
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.
En Gradle versiones anteriores a 7.0, en sistemas similares a Unix, el directorio temporal del sistema puede ser creado con permisos abiertos que permiten a varios usuarios crear y eliminar archivos dentro de él. Las compilaciones de Gradle podrían ser vulnerables a una escalada de privilegios local de un atacante que elimine y vuelva a crear rápidamente archivos en el directorio temporal del sistema. Esta vulnerabilidad afectó las compilaciones que usan plugins de script precompilados escritos en Kotlin DSL y pruebas para plugins de Gradle escritos con ProjectBuilder o TestKit. Si tiene Windows o versiones modernas de macOS, no es vulnerable. Si está en un sistema operativo similar a Unix con el bit "sticky" configurado en el directorio temporal de su sistema, no es vulnerable. El problema se ha corregido y publicado con Gradle 7.0. Como solución alternativa, en sistemas operativos similares a Unix, asegúrese de que el bit "sticky" está establecido. Esto solo permite que el usuario original (o root) elimine un archivo. Si no puede cambiar los permisos del directorio temporal del sistema, puede mover el directorio temporal de Java configurando la propiedad del sistema `java.io.tmpdir`. La nueva ruta debe limitar los permisos solo al usuario de la compilación. Para obtener detalles adicionales, consulte el Aviso de Seguridad de GitHub al que se hace referencia
CVSS Scores
SSVC
- Decision:-
Timeline
- 2021-03-30 CVE Reserved
- 2021-04-13 CVE Published
- 2023-03-08 EPSS Updated
- 2024-08-03 CVE Updated
- 2024-08-03 First Exploit
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-276: Incorrect Default Permissions
- CWE-378: Creation of Temporary File With Insecure Permissions
- CWE-379: Creation of Temporary File in Directory with Insecure Permissions
CAPEC
References (6)
URL | Tag | Source |
---|
URL | Date | SRC |
---|---|---|
https://github.com/gradle/gradle/security/advisories/GHSA-89qm-pxvm-p336 | 2024-08-03 |
URL | Date | SRC |
---|---|---|
https://github.com/gradle/gradle/pull/15240 | 2021-10-20 | |
https://github.com/gradle/gradle/pull/15654 | 2021-10-20 |
URL | Date | SRC |
---|---|---|
https://docs.gradle.org/7.0/release-notes.html#security-advisories | 2021-10-20 | |
https://access.redhat.com/security/cve/CVE-2021-29428 | 2022-05-18 | |
https://bugzilla.redhat.com/show_bug.cgi?id=1949643 | 2022-05-18 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Gradle Search vendor "Gradle" | Gradle Search vendor "Gradle" for product "Gradle" | < 7.0 Search vendor "Gradle" for product "Gradle" and version " < 7.0" | - |
Affected
| ||||||
Quarkus Search vendor "Quarkus" | Quarkus Search vendor "Quarkus" for product "Quarkus" | <= 2.2.3 Search vendor "Quarkus" for product "Quarkus" and version " <= 2.2.3" | - |
Affected
|