Vulnerability in com.datadoghq:datadog-api-client (CVE-2021-21331)
Summary
Vulnerability in com.datadoghq:datadog-api-client (CVE-2021-21331). Risk of unauthorized operations or information disclosure. Exploitable via prepareDownloadFilecreates. Mitigation: upgrade to 1.0.0-beta.9 or later.
Original description
The description as published by the source.
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…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2021-21331 has been found in com.datadoghq:datadog-api-client.
Attackers can target a specific entry point like prepareDownloadFilecreates over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade com.datadoghq:datadog-api-client to 1.0.0-beta.9 or later.
If unsure, ask your IT team or search "com.datadoghq:datadog-api-client CVE-2021-21331" on the vendor's site.
CVE-2021-21331 (com.datadoghq:datadog-api-client) — CWE-378
Attack vector: remote (network-reachable)
Attack surface: prepareDownloadFilecreates / downloadFileFromResponse / java.io.tmpdir
Patched: 1.0.0-beta.9 — apply immediately
Workaround: 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.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-378) exists in com.datadoghq:datadog-api-client. Attackers reach the vulnerable code path via prepareDownloadFilecreates.
Check the vendor advisory for the affected versions of com.datadoghq:datadog-api-client. Attack surface: prepareDownloadFilecreates / downloadFileFromResponse / java.io.tmpdir.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 1.0.0-beta.9.
Workaround: 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.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Audit SBOM/dependencies to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
Audit SBOM/dependencies for affected components.資産台帳・SBOM・依存マニフェストで com.datadoghq:datadog-api-client を使っているサービスとバージョンを洗い出す。
-
2Apply temporary workaround mitigate
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`.パッチが適用されるまでの応急処置として、The recommended workaround is to specify
java.io.tmpdirwhen starting the JVM with the flag-Djava.io.tmpdir, specifying a path to a directory withdrw-------permissions owned bydd-agent. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade com.datadoghq:datadog-api-client to 1.0.0-beta.9ステージング環境で 1.0.0-beta.9 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- web github.com
- web github.com