1. Archivio CVE
  2. 2021
  3. CVE-2021-29428

CVE-2021-29428

7.8 Gravità alta CVSS v3.1 · fonte NVD CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H 7.8 – Alta

Descrizione

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.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
gradle gradle < 7.0 –
quarkus quarkus <= 2.2.3 –
Tutte le 24 vulnerabilità di Gradle

Tipo di vulnerabilità

CWE-378 Creation of Temporary File With Insecure Permissions

Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.

Impatto sui sistemi

AmbitoImpatto
Riservatezza Leggere i dati dell’applicazione
Autorizzazione, Altro Altro
Integrità, Altro Altro

Come si previene

Requisiti Many contemporary languages have functions which properly handle this condition. Older C temp file functions are especially susceptible.
Sviluppo Ensure that you use proper file permissions. This can be achieved by using a safe temp file function. Temporary files should be writable and readable only by the process that owns the file.
Sviluppo Randomize temporary file names. This can also be achieved by using a safe temp-file function. This will ensure that temporary files will not be created in predictable places.

Le indicazioni di mitigazione sono riportate nella lingua originale del catalogo CWE del MITRE.

Tutte le 31 CVE di tipo CWE-378, con andamento e prevenzione

Fonte: catalogo CWE del MITRE · cwe.mitre.org