{"answers":{"affected":"2 open source packages ship an affected version, including com.datadoghq:datadog-api-client. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21331 in the wild and no public exploit code.","fix":"Upgrade com.datadoghq:datadog-api-client to 1.0.0-beta.9 or later.","what":"CVE-2021-21331 is a low-severity vulnerability in datadog-api-client-java, published on 3 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21331 and fix it if it is affected.\n\nWhat it is: CVE-2021-21331 is a low-severity vulnerability in datadog-api-client-java, published on 3 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21331 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- com.datadoghq:datadog-api-client (Maven): affected from 1.0.0-beta.6; fixed in 1.0.0-beta.9\n- com.datadoghq:datadog-api-client (Maven): affected from 1.0.0-beta.6; fixed in 1.0.0-beta.9\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21331/ (Markdown: https://insights.sbomify.com/CVE-2021-21331/index.md)","id":"CVE-2021-21331","markdown":"https://insights.sbomify.com/CVE-2021-21331/index.md","name":"CVE-2021-21331","record":{"aliases":["GHSA-2cxf-6567-7pp6"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Java API client","requires_auth":"low_privilege","summary":"Local attackers can read sensitive files downloaded by the DataDog Java API client due to insecure temporary file permissions on multi-user systems.","user_interaction":"required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"datadog-api-client-java","vendor":"datadoghq"}],"cvss":{"score":3,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-379","name":"Creation of Temporary File in Directory with Insecure Permissions"},{"id":"CWE-378","name":"Creation of Temporary File With Insecure Permissions"}],"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`.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"DataDog API Client contains a Local Information Disclosure Vulnerability","id":"CVE-2021-21331","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"information_disclosure","year":"2021"},"n_packages":2,"n_references":2,"next":{"headline":"Cross-site scripting (XSS) vulnerability in the password reset endpoint","id":"CVE-2021-21332"},"packages":[{"ecosystem":"Maven","fixed":["1.0.0-beta.9"],"introduced":["1.0.0-beta.6"],"last_affected":[],"package":"com.datadoghq:datadog-api-client","purl":null,"source":"GHSA-2cxf-6567-7pp6"},{"ecosystem":"Maven","fixed":["1.0.0-beta.9"],"introduced":["1.0.0-beta.6"],"last_affected":[],"package":"com.datadoghq:datadog-api-client","purl":"pkg:maven/com.datadoghq/datadog-api-client","source":"GHSA-2cxf-6567-7pp6"}],"prev":{"headline":"Open redirect vulnerability in aiohttp","id":"CVE-2021-21330"},"products":["datadog-api-client-java"],"published":"2021-03-03","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["DataDog"]},"summary":"Local attackers can read sensitive files downloaded by the DataDog Java API client due to insecure temporary file permissions on multi-user systems.","url":"https://insights.sbomify.com/CVE-2021-21331/"}