{"api_version":"1","generated_at":"2026-04-22T22:49:48+00:00","cve":"CVE-2021-32804","urls":{"html":"https://cve.report/CVE-2021-32804","api":"https://cve.report/api/cve/CVE-2021-32804.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2021-32804","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-32804"},"summary":{"title":"CVE-2021-32804","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.","state":"PUBLIC","assigner":"security-advisories@github.com","published_at":"2021-08-03 19:15:00","updated_at":"2022-04-25 19:12:00"},"problem_types":["CWE-22"],"metrics":[],"references":[{"url":"https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9","name":"https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9","refsource":"CONFIRM","tags":[],"title":"Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization · Advisory · npm/node-tar · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","name":"https://www.oracle.com/security-alerts/cpuoct2021.html","refsource":"MISC","tags":[],"title":"Oracle Critical Patch Update Advisory - October 2021","mime":"text/html","httpstatus":"200","archivestatus":"200"},{"url":"https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf","name":"https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf","refsource":"CONFIRM","tags":[],"title":"","mime":"application/pdf","httpstatus":"200","archivestatus":"200"},{"url":"https://www.npmjs.com/package/tar","name":"https://www.npmjs.com/package/tar","refsource":"MISC","tags":[],"title":"tar  -  npm","mime":"text/html","httpstatus":"200","archivestatus":"200"},{"url":"https://www.npmjs.com/advisories/1770","name":"https://www.npmjs.com/advisories/1770","refsource":"MISC","tags":[],"title":"Overview","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4","name":"https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4","refsource":"MISC","tags":[],"title":"fix: strip absolute paths more comprehensively · npm/node-tar@1f036ca · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-32804","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32804","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2021","cve_id":"32804","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"oracle","cpe5":"graalvm","cpe6":"20.3.3","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"enterprise","cpe11":"*","cpe12":"*","cpe13":"*"},{"cve_year":"2021","cve_id":"32804","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"oracle","cpe5":"graalvm","cpe6":"21.2.0","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"enterprise","cpe11":"*","cpe12":"*","cpe13":"*"},{"cve_year":"2021","cve_id":"32804","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"siemens","cpe5":"sinec_infrastructure_network_services","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"},{"cve_year":"2021","cve_id":"32804","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"tar_project","cpe5":"tar","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"node.js","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[{"cve":"CVE-2021-32804","qid":"159398","title":"Oracle Enterprise Linux Security Update for nodejs:12 (ELSA-2021-3623)"},{"cve":"CVE-2021-32804","qid":"159408","title":"Oracle Enterprise Linux Security Update for nodejs:14 (ELSA-2021-3666)"},{"cve":"CVE-2021-32804","qid":"179528","title":"Debian Security Update for node-tar (CVE-2021-32804)"},{"cve":"CVE-2021-32804","qid":"239590","title":"Red Hat Update for rh-nodejs12-nodejs and rh-nodejs12-nodejs-nodemon (RHSA-2021:3281)"},{"cve":"CVE-2021-32804","qid":"239591","title":"Red Hat Update for rh-nodejs14-nodejs and rh-nodejs14-nodejs-nodemon (RHSA-2021:3280)"},{"cve":"CVE-2021-32804","qid":"239645","title":"Red Hat Update for nodejs:12 (RHSA-2021:3623)"},{"cve":"CVE-2021-32804","qid":"239654","title":"Red Hat Update for nodejs:12 (RHSA-2021:3639)"},{"cve":"CVE-2021-32804","qid":"239655","title":"Red Hat Update for nodejs:12 (RHSA-2021:3638)"},{"cve":"CVE-2021-32804","qid":"239658","title":"Red Hat Update for nodejs:14 (RHSA-2021:3666)"},{"cve":"CVE-2021-32804","qid":"375828","title":"Node.js Multiple Vulnerabilities (August 2021)"},{"cve":"CVE-2021-32804","qid":"376114","title":"IBM Integration Bus Node.js Vulnerability (6515532,6516066)"},{"cve":"CVE-2021-32804","qid":"377157","title":"Alibaba Cloud Linux Security Update for nodejs:14 (ALINUX3-SA-2021:0072)"},{"cve":"CVE-2021-32804","qid":"690030","title":"Free Berkeley Software Distribution (FreeBSD) Security Update for node.js (7062bce0-1b17-11ec-9d9d-0022489ad614)"},{"cve":"CVE-2021-32804","qid":"751759","title":"SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0563-1)"},{"cve":"CVE-2021-32804","qid":"751773","title":"SUSE Enterprise Linux Security Update for nodejs12 (SUSE-SU-2022:0657-1)"},{"cve":"CVE-2021-32804","qid":"751781","title":"OpenSUSE Security Update for nodejs12 (openSUSE-SU-2022:0657-1)"},{"cve":"CVE-2021-32804","qid":"751783","title":"SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0704-1)"},{"cve":"CVE-2021-32804","qid":"751801","title":"SUSE Enterprise Linux Security Update for nodejs14 (SUSE-SU-2022:0715-1)"},{"cve":"CVE-2021-32804","qid":"751820","title":"OpenSUSE Security Update for nodejs14 (openSUSE-SU-2022:0715-1)"},{"cve":"CVE-2021-32804","qid":"751824","title":"OpenSUSE Security Update for nodejs8 (openSUSE-SU-2022:0704-1)"},{"cve":"CVE-2021-32804","qid":"751826","title":"OpenSUSE Security Update for nodejs8 (openSUSE-SU-22022:20000-2)"},{"cve":"CVE-2021-32804","qid":"752142","title":"SUSE Enterprise Linux Security Update for nodejs10 (SUSE-SU-2022:1717-1)"},{"cve":"CVE-2021-32804","qid":"91839","title":"IBM Integration Bus Node.js Vulnerability (6515532,6516066)"},{"cve":"CVE-2021-32804","qid":"940217","title":"AlmaLinux Security Update for nodejs:12 (ALSA-2021:3623)"},{"cve":"CVE-2021-32804","qid":"940388","title":"AlmaLinux Security Update for nodejs:14 (ALSA-2021:3666)"},{"cve":"CVE-2021-32804","qid":"980366","title":"Nodejs (npm) Security Update for tar (GHSA-3jfq-g458-7qm9)"}]},"source_records":{"cve_program":{"CVE_data_meta":{"ASSIGNER":"security-advisories@github.com","ID":"CVE-2021-32804","STATE":"PUBLIC","TITLE":"Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization"},"affects":{"vendor":{"vendor_data":[{"product":{"product_data":[{"product_name":"node-tar","version":{"version_data":[{"version_value":"< 3.2.2"},{"version_value":">= 4.0.0, < 4.4.14"},{"version_value":">= 5.0.0, < 5.0.6"},{"version_value":">= 6.0.0, < 6.1.1"}]}}]},"vendor_name":"npm"}]}},"data_format":"MITRE","data_type":"CVE","data_version":"4.0","description":{"description_data":[{"lang":"eng","value":"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."}]},"impact":{"cvss":{"attackComplexity":"LOW","attackVector":"LOCAL","availabilityImpact":"NONE","baseScore":8.2,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"CHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","version":"3.1"}},"problemtype":{"problemtype_data":[{"description":[{"lang":"eng","value":"CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"}]}]},"references":{"reference_data":[{"name":"https://www.npmjs.com/package/tar","refsource":"MISC","url":"https://www.npmjs.com/package/tar"},{"name":"https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9","refsource":"CONFIRM","url":"https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9"},{"name":"https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4","refsource":"MISC","url":"https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4"},{"name":"https://www.npmjs.com/advisories/1770","refsource":"MISC","url":"https://www.npmjs.com/advisories/1770"},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","refsource":"MISC","name":"https://www.oracle.com/security-alerts/cpuoct2021.html"},{"refsource":"CONFIRM","name":"https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf","url":"https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf"}]},"source":{"advisory":"GHSA-3jfq-g458-7qm9","discovery":"UNKNOWN"}},"nvd":{"publishedDate":"2021-08-03 19:15:00","lastModifiedDate":"2022-04-25 19:12:00","problem_types":["CWE-22"],"metrics":{"baseMetricV3":{"cvssV3":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseScore":8.1,"baseSeverity":"HIGH"},"exploitabilityScore":2.8,"impactScore":5.2},"baseMetricV2":{"cvssV2":{"version":"2.0","vectorString":"AV:N/AC:M/Au:N/C:N/I:P/A:P","accessVector":"NETWORK","accessComplexity":"MEDIUM","authentication":"NONE","confidentialityImpact":"NONE","integrityImpact":"PARTIAL","availabilityImpact":"PARTIAL","baseScore":5.8},"severity":"MEDIUM","exploitabilityScore":8.6,"impactScore":4.9,"acInsufInfo":false,"obtainAllPrivilege":false,"obtainUserPrivilege":false,"obtainOtherPrivilege":false,"userInteractionRequired":true}},"configurations":{"CVE_data_version":"4.0","nodes":[{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionStartIncluding":"5.0.0","versionEndExcluding":"5.0.6","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionEndExcluding":"3.2.2","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionStartIncluding":"4.0.0","versionEndExcluding":"4.4.14","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionStartIncluding":"6.0.0","versionEndExcluding":"6.1.1","cpe_name":[]}]},{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:*","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:*","cpe_name":[]}]},{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*","versionEndExcluding":"1.0.1.1","cpe_name":[]}]}]}},"legacy_mitre":{"record":{"CveYear":"2021","CveId":"32804","Ordinal":"208192","Title":"CVE-2021-32804","CVE":"CVE-2021-32804","Year":"2021"},"notes":[{"CveYear":"2021","CveId":"32804","Ordinal":"1","NoteData":"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.","Type":"Description","Title":null},{"CveYear":"2021","CveId":"32804","Ordinal":"2","NoteData":"2021-08-03","Type":"Other","Title":"Published"},{"CveYear":"2021","CveId":"32804","Ordinal":"3","NoteData":"2021-10-20","Type":"Other","Title":"Modified"}]}}}