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.
CVSS Details
- CVSS 3.1 Base Score: 8.2
- CVSS 3.1 Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Alma_linux | — | Upgrade npmUpgrade nodejs-full-i18nUpgrade nodejs-nodemonUpgrade nodejs-packagingUpgrade nodejsUpgrade nodejs-develUpgrade nodejs-docs | May 4, 2022 | Aug 3, 2021 |
| Alpine Linux | — | Upgrade tar | Mar 26, 2024 | Aug 3, 2021 |
| Centos_linux | — | Upgrade nodejs-debugsourceUpgrade nodejs-debuginfoUpgrade nodejs-packagingUpgrade nodejs-develUpgrade nodejs-nodemonUpgrade nodejs-full-i18nUpgrade npmUpgrade nodejs-docsUpgrade nodejs | Sep 22, 2021 | Aug 3, 2021 |
| Debian | — | Upgrade node-tar | Jul 30, 2024 | Aug 3, 2021 |
| Freebsd | — | Upgrade node14 | Nov 4, 2022 | Sep 21, 2021 |
| Oracle Solaris | — | Upgrade runtime/nodejs/nodejs-14 to version 14.17.6-11.4.38.0.1.101.2 on Solaris 11.4Upgrade runtime/nodejs/nodejs-12 to version 12.22.5-11.4.38.0.1.101.2 on Solaris 11.4Upgrade runtime/nodejs/nodejs-16 to version 16.11.1-11.4.39.0.1.107.2 on Solaris 11.4Upgrade runtime/nodejs to version 14.17.6-11.4.38.0.1.101.2 on Solaris 11.4 | Nov 17, 2021 | Aug 3, 2021 |
| Oracle_linux | — | Upgrade nodejs-nodemonUpgrade npmUpgrade nodejs-packagingUpgrade nodejs-develUpgrade nodejs-docsUpgrade nodejs-full-i18nUpgrade nodejs | Sep 23, 2021 | Aug 3, 2021 |
| Redhat_linux | — | Upgrade nodejs-debuginfoUpgrade nodejs-debugsourceUpgrade nodejs-packagingUpgrade nodejsUpgrade nodejs-nodemonUpgrade nodejs-full-i18nUpgrade nodejs-docsUpgrade npmUpgrade nodejs-devel | Sep 22, 2021 | Aug 3, 2021 |
| Rocky_linux | — | Upgrade nodejs-debugsourceUpgrade nodejs-full-i18nUpgrade nodejs-debuginfoUpgrade npmUpgrade nodejsUpgrade nodejs-devel | Mar 12, 2024 | Aug 3, 2021 |
| Suse | — | Upgrade nodejs14Upgrade npm10Upgrade nodejs14-docsUpgrade nodejs10-docsUpgrade nodejs10-develUpgrade npm8Upgrade nodejs-commonUpgrade nodejs10Upgrade npm12Upgrade nodejs12-docsUpgrade nodejs12Upgrade nodejs8Upgrade nodejs8-develUpgrade nodejs14-develUpgrade nodejs12-develUpgrade nodejs8-docsUpgrade npm14 | Feb 22, 2022 | Aug 3, 2021 |
| Ubuntu | — | Upgrade node-tar (Ubuntu Pro) | Mar 22, 2023 | Aug 3, 2021 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub