CVE-2021-21331
JSON

3.0low

DataDog API Client contains a Local Information Disclosure Vulnerability

Severity
3.0low CVSS:3.1 by GitHub_M
Exploit likelihood
0.63% (higher than 51% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-2cxf-6567-7pp6

Description

The Java client for the Datadog API before version 1.0.0-beta.9 has a local information disclosure of sensitive information downloaded via the API using the API Client. The Datadog API is executed on a unix-like system with multiple users. The API is used to download a file containing sensitive information. This sensitive information is exposed locally to other users. This vulnerability exists in the API Client for version 1 and 2. The method `prepareDownloadFilecreates` creates a temporary file with the permissions bits of `-rw-r--r--` on unix-like systems. On unix-like systems, the system temporary directory is shared between users. As such, the contents of the file downloaded via the `downloadFileFromResponse` method will be visible to all other users on the local system. Analysis of the finding determined that the affected code was unused, meaning that the exploitation likelihood is low. The unused code has been removed, effectively mitigating this issue. This issue has been patched in version 1.0.0-beta.9. As a workaround one may specify `java.io.tmpdir` when starting the JVM with the flag `-Djava.io.tmpdir`, specifying a path to a directory with `drw-------` permissions owned by `dd-agent`.

Affected

Product or packageVersionsReported by
DataDog datadog-api-client-java< 1.0.0-beta.9CVE List
com.datadoghq:datadog-api-client (Maven)from 1.0.0-beta.6 before 1.0.0-beta.9GitHub Advisory Database
datadoghq datadog-api-client-java1.0.0NVD

All scores

GitHub_M3.0low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N
GitHub3.0low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N
NVD3.3low CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:N/A:N

Classification

What each source says

CVE List

The Java client for the Datadog API before version 1.0.0-beta.9 has a local information disclosure of sensitive information downloaded via the API using the API Client. The Datadog API is executed on a unix-like system with multiple users. The API is used to download a file containing sensitive information. This sensitive information is exposed locally to other users. This vulnerability exists in the API Client for version 1 and 2. The method `prepareDownloadFilecreates` creates a temporary file with the permissions bits of `-rw-r--r--` on unix-like systems. On unix-like systems, the system temporary directory is shared between users. As such, the contents of the file downloaded via the `downloadFileFromResponse` method will be visible to all other users on the local system. Analysis of the finding determined that the affected code was unused, meaning that the exploitation likelihood is low. The unused code has been removed, effectively mitigating this issue. This issue has been patched in version 1.0.0-beta.9. As a workaround one may specify `java.io.tmpdir` when starting the JVM with the flag `-Djava.io.tmpdir`, specifying a path to a directory with `drw-------` permissions owned by `dd-agent`.

GitHub Advisory Database
Impact

Local information disclosure of sensitive information downloaded via the API using the API Client.

Finding

The Datadog API is executed on a unix-like system with multiple users. The API is used to download a file containing sensitive information. This sensitive information is exposed locally to other users. This vulnerability exists in the API Client for version 1 and 2. The method prepareDownloadFilecreates creates a temporary file with the permissions bits of -rw-r--r-- on unix-like systems. On unix-like systems, the system temporary directory is shared between users. As such, the contents of the file downloaded via the downloadFileFromResponse method will be visible to all other users on the local system.

Analysis of the finding determined that the affected code was unused, meaning that the exploitation likelihood is low. The unused code has been removed, effectively mitigating this issue.

This vulnerability was found due to this query that Jonathan Leitschuh contributed to the Semmle QL project.

Patches

This issue has been patched in version 1.0.0-beta.9.

See also Remove unused downloadFile helpers.

Workarounds

The recommended workaround is to specify java.io.tmpdir when starting the JVM with the flag -Djava.io.tmpdir, specifying a path to a directory with drw------- permissions owned by dd-agent.

References
For more information

If you have any questions or comments about this advisory:

NVD (es)

El cliente Java para la API Datadog anterior a la versión 1.0.0-beta.9, presenta una divulgación de información local de información confidencial descargada por medio de la API mediante la API Client.&#xa0;La API Datadog se ejecuta en un sistema similar a Unix con múltiples usuarios.&#xa0;La API se usa para descargar un archivo que contiene información confidencial.&#xa0;Esta información confidencial está expuesta localmente a otros usuarios.&#xa0;Esta vulnerabilidad existe en la API Client para versión 1 y 2. El método "prepareDownloadFilecreates" crea un archivo temporal con los bits de permisos de "-rw-r--r--" en sistemas similares a Unix.&#xa0;En sistemas similares a Unix, el directorio temporal del sistema se comparte entre los usuarios.&#xa0;Como tal, el contenido del archivo descargado a través del método "downloadFileFromResponse" será visible para todos los demás usuarios en el sistema local.&#xa0;El análisis del hallazgo determinó que el código afectado no se usó,&#xa0;lo que significa que la probabilidad de explotación es baja.&#xa0;El código no usado se ha eliminado, lo que mitiga de forma eficaz este problema.&#xa0;Este problema se ha corregido en la versión 1.0.0-beta.9.&#xa0;Como solución alternativa, se puede especificar "java.io.tmpdir" al iniciar la JVM con el indicador "-Djava.io.tmpdir", especificando una ruta a un directorio con permisos "drw-------" propiedad de "dd-agent"

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21331 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-2cxf-6567-7pp6 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21331 changed 2026-06-17Public domain