{"api_version":"1","generated_at":"2026-04-22T20:52:46+00:00","cve":"CVE-2021-39135","urls":{"html":"https://cve.report/CVE-2021-39135","api":"https://cve.report/api/cve/CVE-2021-39135.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2021-39135","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-39135"},"summary":{"title":"CVE-2021-39135","description":"`@npmcli/arborist`, the library that calculates dependency trees and manages the node_modules folder hierarchy for the npm command line interface, aims to guarantee that package dependency contracts will be met, and the extraction of package contents will always be performed into the expected folder. This is accomplished by extracting package contents into a project's `node_modules` folder. If the `node_modules` folder of the root project or any of its dependencies is somehow replaced with a symbolic link, it could allow Arborist to write package dependencies to any arbitrary location on the file system. Note that symbolic links contained within package artifact contents are filtered out, so another means of creating a `node_modules` symbolic link would have to be employed. 1. A `preinstall` script could replace `node_modules` with a symlink. (This is prevented by using `--ignore-scripts`.) 2. An attacker could supply the target with a git repository, instructing them to run `npm install --ignore-scripts` in the root. This may be successful, because `npm install --ignore-scripts` is typically not capable of making changes outside of the project directory, so it may be deemed safe. This is patched in @npmcli/arborist 2.8.2 which is included in npm v7.20.7 and above. For more information including workarounds please see the referenced GHSA-gmw6-94gg-2rc2.","state":"PUBLIC","assigner":"security-advisories@github.com","published_at":"2021-08-31 17:15:00","updated_at":"2023-11-07 03:37:00"},"problem_types":["CWE-61"],"metrics":[],"references":[{"url":"https://www.npmjs.com/package/%40npmcli/arborist","name":"https://www.npmjs.com/package/%40npmcli/arborist","refsource":"","tags":[],"title":"@npmcli/arborist  -  npm","mime":"text/html","httpstatus":"200","archivestatus":"200"},{"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://github.com/npm/arborist/security/advisories/GHSA-gmw6-94gg-2rc2","name":"https://github.com/npm/arborist/security/advisories/GHSA-gmw6-94gg-2rc2","refsource":"CONFIRM","tags":[],"title":"UNIX Symbolic Link (Symlink) Following in @npmcli/arborist · Advisory · npm/arborist · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.npmjs.com/package/@npmcli/arborist","name":"https://www.npmjs.com/package/@npmcli/arborist","refsource":"MISC","tags":[],"title":"@npmcli/arborist  -  npm","mime":"text/html","httpstatus":"200","archivestatus":"200"},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-39135","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39135","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2021","cve_id":"39135","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"npmjs","cpe5":"arborist","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"node.js","cpe12":"*","cpe13":"*"},{"cve_year":"2021","cve_id":"39135","vulnerable":"-1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"npmjs","cpe5":"npm","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"},{"cve_year":"2021","cve_id":"39135","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":"39135","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":"39135","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":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[{"cve":"CVE-2021-39135","qid":"183402","title":"Debian Security Update for npm (CVE-2021-39135)"},{"cve":"CVE-2021-39135","qid":"296065","title":"Oracle Solaris 11.4 Support Repository Update (SRU) 39.107.1 Missing (CPUOCT2021)"},{"cve":"CVE-2021-39135","qid":"375828","title":"Node.js Multiple Vulnerabilities (August 2021)"},{"cve":"CVE-2021-39135","qid":"500445","title":"Alpine Linux Security Update for nodejs"},{"cve":"CVE-2021-39135","qid":"501454","title":"Alpine Linux Security Update for nodejs"},{"cve":"CVE-2021-39135","qid":"504208","title":"Alpine Linux Security Update for nodejs"},{"cve":"CVE-2021-39135","qid":"690030","title":"Free Berkeley Software Distribution (FreeBSD) Security Update for node.js (7062bce0-1b17-11ec-9d9d-0022489ad614)"},{"cve":"CVE-2021-39135","qid":"751457","title":"OpenSUSE Security Update for nodejs12 (openSUSE-SU-2021:3940-1)"},{"cve":"CVE-2021-39135","qid":"751475","title":"OpenSUSE Security Update for nodejs14 (openSUSE-SU-2021:3964-1)"},{"cve":"CVE-2021-39135","qid":"751509","title":"OpenSUSE Security Update for nodejs12 (openSUSE-SU-2021:1574-1)"},{"cve":"CVE-2021-39135","qid":"751518","title":"OpenSUSE Security Update for nodejs14 (openSUSE-SU-2021:1552-1)"},{"cve":"CVE-2021-39135","qid":"980371","title":"Nodejs (npm) Security Update for @npmcli/arborist2 (GHSA-gmw6-94gg-2rc2)"}]},"source_records":{"cve_program":{"CVE_data_meta":{"ASSIGNER":"security-advisories@github.com","ID":"CVE-2021-39135","STATE":"PUBLIC","TITLE":"UNIX Symbolic Link (Symlink) Following in @npmcli/arborist"},"affects":{"vendor":{"vendor_data":[{"product":{"product_data":[{"product_name":"arborist","version":{"version_data":[{"version_value":"< 2.8.2"}]}}]},"vendor_name":"npm"}]}},"data_format":"MITRE","data_type":"CVE","data_version":"4.0","description":{"description_data":[{"lang":"eng","value":"`@npmcli/arborist`, the library that calculates dependency trees and manages the node_modules folder hierarchy for the npm command line interface, aims to guarantee that package dependency contracts will be met, and the extraction of package contents will always be performed into the expected folder. This is accomplished by extracting package contents into a project's `node_modules` folder. If the `node_modules` folder of the root project or any of its dependencies is somehow replaced with a symbolic link, it could allow Arborist to write package dependencies to any arbitrary location on the file system. Note that symbolic links contained within package artifact contents are filtered out, so another means of creating a `node_modules` symbolic link would have to be employed. 1. A `preinstall` script could replace `node_modules` with a symlink. (This is prevented by using `--ignore-scripts`.) 2. An attacker could supply the target with a git repository, instructing them to run `npm install --ignore-scripts` in the root. This may be successful, because `npm install --ignore-scripts` is typically not capable of making changes outside of the project directory, so it may be deemed safe. This is patched in @npmcli/arborist 2.8.2 which is included in npm v7.20.7 and above. For more information including workarounds please see the referenced GHSA-gmw6-94gg-2rc2."}]},"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-61: UNIX Symbolic Link (Symlink) Following"}]}]},"references":{"reference_data":[{"name":"https://www.npmjs.com/package/@npmcli/arborist","refsource":"MISC","url":"https://www.npmjs.com/package/@npmcli/arborist"},{"name":"https://github.com/npm/arborist/security/advisories/GHSA-gmw6-94gg-2rc2","refsource":"CONFIRM","url":"https://github.com/npm/arborist/security/advisories/GHSA-gmw6-94gg-2rc2"},{"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-gmw6-94gg-2rc2","discovery":"UNKNOWN"}},"nvd":{"publishedDate":"2021-08-31 17:15:00","lastModifiedDate":"2023-11-07 03:37:00","problem_types":["CWE-61"],"metrics":{"baseMetricV3":{"cvssV3":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseScore":7.8,"baseSeverity":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9},"baseMetricV2":{"cvssV2":{"version":"2.0","vectorString":"AV:L/AC:M/Au:N/C:P/I:P/A:P","accessVector":"LOCAL","accessComplexity":"MEDIUM","authentication":"NONE","confidentialityImpact":"PARTIAL","integrityImpact":"PARTIAL","availabilityImpact":"PARTIAL","baseScore":4.4},"severity":"MEDIUM","exploitabilityScore":3.4,"impactScore":6.4,"acInsufInfo":false,"obtainAllPrivilege":false,"obtainUserPrivilege":false,"obtainOtherPrivilege":false,"userInteractionRequired":true}},"configurations":{"CVE_data_version":"4.0","nodes":[{"operator":"AND","children":[{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:npmjs:arborist:*:*:*:*:*:node.js:*:*","versionEndExcluding":"2.8.2","cpe_name":[]}]},{"operator":"OR","children":[],"cpe_match":[{"vulnerable":false,"cpe23Uri":"cpe:2.3:a:npmjs:npm:*:*:*:*:*:*:*:*","versionEndExcluding":"7.20.7","cpe_name":[]}]}],"cpe_match":[]},{"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":"39135","Ordinal":"214838","Title":"CVE-2021-39135","CVE":"CVE-2021-39135","Year":"2021"},"notes":[{"CveYear":"2021","CveId":"39135","Ordinal":"1","NoteData":"`@npmcli/arborist`, the library that calculates dependency trees and manages the node_modules folder hierarchy for the npm command line interface, aims to guarantee that package dependency contracts will be met, and the extraction of package contents will always be performed into the expected folder. This is accomplished by extracting package contents into a project's `node_modules` folder. If the `node_modules` folder of the root project or any of its dependencies is somehow replaced with a symbolic link, it could allow Arborist to write package dependencies to any arbitrary location on the file system. Note that symbolic links contained within package artifact contents are filtered out, so another means of creating a `node_modules` symbolic link would have to be employed. 1. A `preinstall` script could replace `node_modules` with a symlink. (This is prevented by using `--ignore-scripts`.) 2. An attacker could supply the target with a git repository, instructing them to run `npm install --ignore-scripts` in the root. This may be successful, because `npm install --ignore-scripts` is typically not capable of making changes outside of the project directory, so it may be deemed safe. This is patched in @npmcli/arborist 2.8.2 which is included in npm v7.20.7 and above. For more information including workarounds please see the referenced GHSA-gmw6-94gg-2rc2.","Type":"Description","Title":null},{"CveYear":"2021","CveId":"39135","Ordinal":"2","NoteData":"2021-08-31","Type":"Other","Title":"Published"},{"CveYear":"2021","CveId":"39135","Ordinal":"3","NoteData":"2021-10-20","Type":"Other","Title":"Modified"}]}}}