{"api_version":"1","generated_at":"2026-04-22T22:49:54+00:00","cve":"CVE-2021-32803","urls":{"html":"https://cve.report/CVE-2021-32803","api":"https://cve.report/api/cve/CVE-2021-32803.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2021-32803","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-32803"},"summary":{"title":"CVE-2021-32803","description":"The npm package \"tar\" (aka node-tar) before versions 6.1.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. `node-tar` aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary `stat` calls to determine whether a given path is a directory, paths are cached when directories are created. This logic was insufficient when extracting tar files that contained both a directory and a symlink with the same name as the directory. This order of operations resulted in the directory being created and added to the `node-tar` directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where `node-tar` checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, it was thus possible to bypass `node-tar` symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and subsequently extracting arbitrary files into that location, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2.","state":"PUBLIC","assigner":"security-advisories@github.com","published_at":"2021-08-03 19:15:00","updated_at":"2022-07-02 18:28:00"},"problem_types":["CWE-59"],"metrics":[],"references":[{"url":"https://github.com/npm/node-tar/commit/9dbdeb6df8e9dbd96fa9e84341b9d74734be6c20","name":"https://github.com/npm/node-tar/commit/9dbdeb6df8e9dbd96fa9e84341b9d74734be6c20","refsource":"MISC","tags":[],"title":"Remove paths from dirCache when no longer dirs · npm/node-tar@9dbdeb6 · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.npmjs.com/advisories/1771","name":"https://www.npmjs.com/advisories/1771","refsource":"MISC","tags":[],"title":"Overview","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://github.com/npm/node-tar/security/advisories/GHSA-r628-mhmh-qjhw","name":"https://github.com/npm/node-tar/security/advisories/GHSA-r628-mhmh-qjhw","refsource":"CONFIRM","tags":[],"title":"Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning · Advisory · npm/node-tar · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"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.cve.org/CVERecord?id=CVE-2021-32803","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32803","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2021","cve_id":"32803","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":"32803","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":"32803","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":"32803","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-32803","qid":"159398","title":"Oracle Enterprise Linux Security Update for nodejs:12 (ELSA-2021-3623)"},{"cve":"CVE-2021-32803","qid":"159408","title":"Oracle Enterprise Linux Security Update for nodejs:14 (ELSA-2021-3666)"},{"cve":"CVE-2021-32803","qid":"180594","title":"Debian Security Update for node-tar (CVE-2021-32803)"},{"cve":"CVE-2021-32803","qid":"239590","title":"Red Hat Update for rh-nodejs12-nodejs and rh-nodejs12-nodejs-nodemon (RHSA-2021:3281)"},{"cve":"CVE-2021-32803","qid":"239591","title":"Red Hat Update for rh-nodejs14-nodejs and rh-nodejs14-nodejs-nodemon (RHSA-2021:3280)"},{"cve":"CVE-2021-32803","qid":"239645","title":"Red Hat Update for nodejs:12 (RHSA-2021:3623)"},{"cve":"CVE-2021-32803","qid":"239654","title":"Red Hat Update for nodejs:12 (RHSA-2021:3639)"},{"cve":"CVE-2021-32803","qid":"239655","title":"Red Hat Update for nodejs:12 (RHSA-2021:3638)"},{"cve":"CVE-2021-32803","qid":"239658","title":"Red Hat Update for nodejs:14 (RHSA-2021:3666)"},{"cve":"CVE-2021-32803","qid":"375828","title":"Node.js Multiple Vulnerabilities (August 2021)"},{"cve":"CVE-2021-32803","qid":"376114","title":"IBM Integration Bus Node.js Vulnerability (6515532,6516066)"},{"cve":"CVE-2021-32803","qid":"377157","title":"Alibaba Cloud Linux Security Update for nodejs:14 (ALINUX3-SA-2021:0072)"},{"cve":"CVE-2021-32803","qid":"690030","title":"Free Berkeley Software Distribution (FreeBSD) Security Update for node.js (7062bce0-1b17-11ec-9d9d-0022489ad614)"},{"cve":"CVE-2021-32803","qid":"751759","title":"SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0563-1)"},{"cve":"CVE-2021-32803","qid":"751773","title":"SUSE Enterprise Linux Security Update for nodejs12 (SUSE-SU-2022:0657-1)"},{"cve":"CVE-2021-32803","qid":"751781","title":"OpenSUSE Security Update for nodejs12 (openSUSE-SU-2022:0657-1)"},{"cve":"CVE-2021-32803","qid":"751783","title":"SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0704-1)"},{"cve":"CVE-2021-32803","qid":"751801","title":"SUSE Enterprise Linux Security Update for nodejs14 (SUSE-SU-2022:0715-1)"},{"cve":"CVE-2021-32803","qid":"751820","title":"OpenSUSE Security Update for nodejs14 (openSUSE-SU-2022:0715-1)"},{"cve":"CVE-2021-32803","qid":"751824","title":"OpenSUSE Security Update for nodejs8 (openSUSE-SU-2022:0704-1)"},{"cve":"CVE-2021-32803","qid":"751826","title":"OpenSUSE Security Update for nodejs8 (openSUSE-SU-22022:20000-2)"},{"cve":"CVE-2021-32803","qid":"752142","title":"SUSE Enterprise Linux Security Update for nodejs10 (SUSE-SU-2022:1717-1)"},{"cve":"CVE-2021-32803","qid":"91839","title":"IBM Integration Bus Node.js Vulnerability (6515532,6516066)"},{"cve":"CVE-2021-32803","qid":"940217","title":"AlmaLinux Security Update for nodejs:12 (ALSA-2021:3623)"},{"cve":"CVE-2021-32803","qid":"940388","title":"AlmaLinux Security Update for nodejs:14 (ALSA-2021:3666)"},{"cve":"CVE-2021-32803","qid":"980365","title":"Nodejs (npm) Security Update for tar (GHSA-r628-mhmh-qjhw)"}]},"source_records":{"cve_program":{"CVE_data_meta":{"ASSIGNER":"security-advisories@github.com","ID":"CVE-2021-32803","STATE":"PUBLIC","TITLE":"Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning"},"affects":{"vendor":{"vendor_data":[{"product":{"product_data":[{"product_name":"node-tar","version":{"version_data":[{"version_value":"< 3.2.3"},{"version_value":">= 4.0.0, < 4.4.15"},{"version_value":">= 5.0.0, < 5.0.7"},{"version_value":">= 6.0.0, < 6.1.2"}]}}]},"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.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. `node-tar` aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary `stat` calls to determine whether a given path is a directory, paths are cached when directories are created. This logic was insufficient when extracting tar files that contained both a directory and a symlink with the same name as the directory. This order of operations resulted in the directory being created and added to the `node-tar` directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where `node-tar` checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, it was thus possible to bypass `node-tar` symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and subsequently extracting arbitrary files into that location, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2."}]},"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://github.com/npm/node-tar/security/advisories/GHSA-r628-mhmh-qjhw","refsource":"CONFIRM","url":"https://github.com/npm/node-tar/security/advisories/GHSA-r628-mhmh-qjhw"},{"name":"https://github.com/npm/node-tar/commit/9dbdeb6df8e9dbd96fa9e84341b9d74734be6c20","refsource":"MISC","url":"https://github.com/npm/node-tar/commit/9dbdeb6df8e9dbd96fa9e84341b9d74734be6c20"},{"name":"https://www.npmjs.com/advisories/1771","refsource":"MISC","url":"https://www.npmjs.com/advisories/1771"},{"name":"https://www.npmjs.com/package/tar","refsource":"MISC","url":"https://www.npmjs.com/package/tar"},{"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-r628-mhmh-qjhw","discovery":"UNKNOWN"}},"nvd":{"publishedDate":"2021-08-03 19:15:00","lastModifiedDate":"2022-07-02 18:28:00","problem_types":["CWE-59"],"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.7","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionEndExcluding":"3.2.3","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionStartIncluding":"4.0.0","versionEndExcluding":"4.4.15","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*","versionStartIncluding":"6.0.0","versionEndExcluding":"6.1.2","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":"32803","Ordinal":"208191","Title":"CVE-2021-32803","CVE":"CVE-2021-32803","Year":"2021"},"notes":[{"CveYear":"2021","CveId":"32803","Ordinal":"1","NoteData":"The npm package \"tar\" (aka node-tar) before versions 6.1.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. `node-tar` aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary `stat` calls to determine whether a given path is a directory, paths are cached when directories are created. This logic was insufficient when extracting tar files that contained both a directory and a symlink with the same name as the directory. This order of operations resulted in the directory being created and added to the `node-tar` directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where `node-tar` checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, it was thus possible to bypass `node-tar` symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and subsequently extracting arbitrary files into that location, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2.","Type":"Description","Title":null},{"CveYear":"2021","CveId":"32803","Ordinal":"2","NoteData":"2021-08-03","Type":"Other","Title":"Published"},{"CveYear":"2021","CveId":"32803","Ordinal":"3","NoteData":"2021-10-20","Type":"Other","Title":"Modified"}]}}}