{"answers":{"affected":"8 open source packages ship an affected version, including tar. It affects 3 products.","exploited":"There is no known exploitation of CVE-2021-32804 in the wild and no public exploit code.","fix":"Upgrade tar to a fixed version for your release line: 3.2.2, 4.4.14, 5.0.6 or 6.1.1.","what":"CVE-2021-32804 is a high-severity path traversal vulnerability in Oracle Graalvm, published on 3 Aug 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-32804 and fix it if it is affected.\n\nWhat it is: CVE-2021-32804 is a high-severity path traversal vulnerability in Oracle Graalvm, published on 3 Aug 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-32804 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- tar (npm): affected all versions; fixed in 3.2.2\n- tar (npm): affected all versions; fixed in 3.2.2\n- tar (npm): affected from 4.0.0; fixed in 4.4.14\n- tar (npm): affected from 4.0.0; fixed in 4.4.14\n- tar (npm): affected from 5.0.0; fixed in 5.0.6\n- tar (npm): affected from 5.0.0; fixed in 5.0.6\n- tar (npm): affected from 6.0.0; fixed in 6.1.1\n- tar (npm): affected from 6.0.0; fixed in 6.1.1\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-32804/ (Markdown: https://insights.sbomify.com/CVE-2021-32804/index.md)","id":"CVE-2021-32804","markdown":"https://insights.sbomify.com/CVE-2021-32804/index.md","name":"CVE-2021-32804","record":{"aliases":["CLSA-2026-1775176096","CLSA-2026-1777941831","DEBIAN-CVE-2021-32804","GHSA-3jfq-g458-7qm9","ROOT-APP-NPM-CVE-2021-32804","UBUNTU-CVE-2021-32804"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify","code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Node.js tar library","requires_auth":"none","summary":"Attackers can overwrite arbitrary files via crafted tar archives with repeated path roots, potentially leading to code execution.","user_interaction":"required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"graalvm","vendor":"oracle"},{"product":"sinec_infrastructure_network_services","vendor":"siemens"},{"product":"tar","vendor":"tar_project"}],"cvss":{"score":8.2,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"The npm package \"tar\" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into `home/user/.bashrc`. This logic was insufficient when file paths contained repeated path roots such as `////home/user/.bashrc`. `node-tar` would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. `///home/user/.bashrc`) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. Users may work around this vulnerability without upgrading by creating a custom `onentry` method which sanitizes the `entry.path` or a `filter` method which removes entries with absolute paths. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2021-08-31","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2021-08-31T04:32:38Z","kind":"github_poc","ref":"https://github.com/yamory/CVE-2021-32804","stars":1,"title":null}],"tier":"poc_unverified"},"has_fix":true,"headline":"Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization","id":"CVE-2021-32804","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":"oracle:graalvm","products":["oracle:graalvm","siemens:sinec_infrastructure_network_services"],"type":"path_traversal","year":"2021"},"n_packages":8,"n_references":6,"next":{"headline":"URL Redirection to Untrusted Site ('Open Redirect') in Flask-AppBuilder","id":"CVE-2021-32805"},"packages":[{"ecosystem":"npm","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"tar","purl":null,"source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"tar","purl":"pkg:npm/tar","source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["4.4.14"],"introduced":["4.0.0"],"last_affected":[],"package":"tar","purl":null,"source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["4.4.14"],"introduced":["4.0.0"],"last_affected":[],"package":"tar","purl":"pkg:npm/tar","source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["5.0.6"],"introduced":["5.0.0"],"last_affected":[],"package":"tar","purl":null,"source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["5.0.6"],"introduced":["5.0.0"],"last_affected":[],"package":"tar","purl":"pkg:npm/tar","source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["6.1.1"],"introduced":["6.0.0"],"last_affected":[],"package":"tar","purl":null,"source":"GHSA-3jfq-g458-7qm9"},{"ecosystem":"npm","fixed":["6.1.1"],"introduced":["6.0.0"],"last_affected":[],"package":"tar","purl":"pkg:npm/tar","source":"GHSA-3jfq-g458-7qm9"}],"prev":{"headline":"Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning","id":"CVE-2021-32803"},"products":["node-tar"],"published":"2021-08-03","related":[{"cvss_score":8.6,"headline":"Security feature bypass in Oracle GraalVM Enterprise Edition","id":"CVE-2025-50059","kev_date_added":null,"published":"2025-07-15"},{"cvss_score":8.2,"headline":"Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning","id":"CVE-2021-32803","kev_date_added":null,"published":"2021-08-03"},{"cvss_score":8.1,"headline":"Code injection in Oracle GraalVM Enterprise Edition","id":"CVE-2025-30749","kev_date_added":null,"published":"2025-07-15"},{"cvss_score":8.1,"headline":"Code injection in Oracle GraalVM Enterprise Edition","id":"CVE-2025-50106","kev_date_added":null,"published":"2025-07-15"},{"cvss_score":7.8,"headline":"Privilege escalation in Oracle GraalVM Enterprise Edition","id":"CVE-2026-62574","kev_date_added":null,"published":"2026-07-21"},{"cvss_score":7.7,"headline":"Denial of service in GraalVM Enterprise Edition","id":"CVE-2020-2802","kev_date_added":null,"published":"2020-04-15"}],"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)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["npm"]},"summary":"Attackers can overwrite arbitrary files via crafted tar archives with repeated path roots, potentially leading to code execution.","url":"https://insights.sbomify.com/CVE-2021-32804/"}