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 package | Versions | Reported by |
|---|---|---|
| DataDog datadog-api-client-java | < 1.0.0-beta.9 | CVE List |
| com.datadoghq:datadog-api-client (Maven) | from 1.0.0-beta.6 before 1.0.0-beta.9 | GitHub Advisory Database |
| datadoghq datadog-api-client-java | 1.0.0 | NVD |
All scores
| GitHub_M | 3.0low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N |
| GitHub | 3.0low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N |
| NVD | 3.3low CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N |
| NVD | 4.3medium CVSS:2.0 | AV: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
- CWE-378: Creation of Temporary File With Insecure Permissions
- CWE-379: Creation of Temporary File in Directory with Insecure Permissions
For more information
If you have any questions or comments about this advisory:
- Open an issue in DataDog/datadog-api-client-java
- Email us at security@datadoghq.com
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. La API Datadog se ejecuta en un sistema similar a Unix con múltiples usuarios. La API se usa para descargar un archivo que contiene información confidencial. Esta información confidencial está expuesta localmente a otros usuarios. 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. En sistemas similares a Unix, el directorio temporal del sistema se comparte entre los usuarios. 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. El análisis del hallazgo determinó que el código afectado no se usó, lo que significa que la probabilidad de explotación es baja. El código no usado se ha eliminado, lo que mitiga de forma eficaz este problema. Este problema se ha corregido en la versión 1.0.0-beta.9. 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
| https://github.com/DataDog/datadog-api-client-java/security/advisories/GHSA-2cxf-6567-7pp6 | patch, third-party-advisory, web | |
| https://github.com/DataDog/datadog-api-client-java/releases/tag/datadog-api-client-1.0.0-beta.9 | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21331 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21331 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2cxf-6567-7pp6 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-21331 changed 2026-06-17 | Public domain |