Skip to content
Heist/ feed
Back to feed
Low

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21331

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

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21331
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:05 UTC · Revision 1

Source evidence

CVE-2021-21331

core-osv · Original source

Published 3 Mar 2021, 23:15 UTC

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

osv:CVE-2021-21331
Complete source record
{
  "id": "95799ed2845a854456c8bc630e7233b2806d4be33918111092ef641a95f68b6d",
  "url": "https://osv.dev/vulnerability/CVE-2021-21331",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21331",
    "summary": "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`.",
    "evidence": "osv:CVE-2021-21331",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2021-21331",
      "aliases": [
        "CVE-2021-21331",
        "GHSA-2cxf-6567-7pp6"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/datadog/datadog-api-client-java",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "184b93c3dc258f8dd5830b5ae13ea8d27d55b369"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.0.0-beta.9"
                      }
                    ],
                    "source": "DESCRIPTION"
                  },
                  {
                    "range": [
                      {
                        "fixed": "184b93c3dc258f8dd5830b5ae13ea8d27d55b369"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "datadog-api-client-1.0.0-beta.9"
                  }
                ]
              }
            }
          ],
          "versions": [
            "datadog-api-client-1.0.0-beta.8",
            "datadog-api-client-1.0.0-beta.7",
            "datadog-api-client-1.0.0-beta.6",
            "datadog-api-client-1.0.0-beta.5",
            "datadog-api-client-1.0.0-beta.4",
            "datadog-api-client-1.0.0-beta.3",
            "datadog-api-client-1.0.0-beta.2",
            "datadog-api-client-1.0.0-beta.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21331.json"
          }
        }
      ],
      "modified": "2026-10-20T10:56:57.310366147Z",
      "provider": "osv",
      "references": [
        "https://github.com/DataDog/datadog-api-client-java/releases/tag/datadog-api-client-1.0.0-beta.9",
        "https://github.com/DataDog/datadog-api-client-java/security/advisories/GHSA-2cxf-6567-7pp6"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta1:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta2:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta3:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta4:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta5:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta6:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta7:*:*:*:*:*:*",
              "cpe:2.3:a:datadoghq:datadog-api-client-java:1.0.0:beta8:*:*:*:*:*:*"
            ],
            "vendor_product": "datadoghq:datadog-api-client-java",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "1.0.0-beta1"
                  },
                  {
                    "last_affected": "1.0.0-beta1"
                  },
                  {
                    "introduced": "1.0.0-beta2"
                  },
                  {
                    "last_affected": "1.0.0-beta2"
                  },
                  {
                    "introduced": "1.0.0-beta3"
                  },
                  {
                    "last_affected": "1.0.0-beta3"
                  },
                  {
                    "introduced": "1.0.0-beta4"
                  },
                  {
                    "last_affected": "1.0.0-beta4"
                  },
                  {
                    "introduced": "1.0.0-beta5"
                  },
                  {
                    "last_affected": "1.0.0-beta5"
                  },
                  {
                    "introduced": "1.0.0-beta6"
                  },
                  {
                    "last_affected": "1.0.0-beta6"
                  },
                  {
                    "introduced": "1.0.0-beta7"
                  },
                  {
                    "last_affected": "1.0.0-beta7"
                  },
                  {
                    "introduced": "1.0.0-beta8"
                  },
                  {
                    "last_affected": "1.0.0-beta8"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-21331",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 387091,
  "published_at": "2021-03-03T23:15:11.463+00:00"
}