Description
The npm package "tar" (aka node-tar) before versions 4.4.18, 5.0.10, and 6.1.9 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. node-tar aims to guarantee that any file whose location would be outside of the extraction target directory is not extracted. This is, in part, accomplished by sanitizing absolute paths of entries within the archive, skipping archive entries that contain `..` path portions, and resolving the sanitized paths against the extraction target directory. This logic was insufficient on Windows systems when extracting tar files that contained a path that was not an absolute path, but specified a drive letter different from the extraction target, such as `C:some\path`. If the drive letter does not match the extraction target, for example `D:\extraction\dir`, then the result of `path.resolve(extractionDirectory, entryPath)` would resolve against the current working directory on the `C:` drive, rather than the extraction target directory. Additionally, a `..` portion of the path could occur immediately after the drive letter, such as `C:../foo`, and was not properly sanitized by the logic that checked for `..` within the normalized and split portions of the path. This only affects users of `node-tar` on Windows systems. These issues were addressed in releases 4.4.18, 5.0.10 and 6.1.9. The v3 branch of node-tar has been deprecated and did not receive patches for these issues. If you are still using a v3 release we recommend you update to a more recent version of node-tar. There is no reasonable way to work around this issue without performing the same path normalization procedures that node-tar now does. Users are encouraged to upgrade to the latest patched versions of node-tar, rather than attempt to sanitize paths themselves.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| npm | node-tar | < 4.4.18, >= 5.0.0, < 5.0.10, >= 6.0.0, < 6.1.9 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP3 | nodejs12 | 12.22.7-4.22.1 | SUSE-SU-2021:3940-1 |
| SLES 15 SP3 | nodejs14 | 14.18.1-15.21.2 | SUSE-SU-2021:3964-1 |
| SLES 15 SP2 | nodejs12 | 12.22.7-4.22.1 | SUSE-SU-2021:3940-1 |
| SLES 15 SP2 | nodejs14 | 14.18.1-15.21.2 | SUSE-SU-2021:3964-1 |
| SLES 12 | nodejs12 | 12.22.9-1.38.1 | SUSE-SU-2022:0101-1 |
| SLES 12 | nodejs14 | 14.18.1-6.18.2 | SUSE-SU-2021:3886-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | nodejs14 | 14.18.1-1.1 | openSUSE-SU-2024:11616-1 |
| openSUSE Leap 15.3 | nodejs12 | 12.22.7-4.22.1 | openSUSE-SU-2021:3940-1 |
| openSUSE Leap 15.3 | nodejs14 | 14.18.1-15.21.2 | openSUSE-SU-2021:3964-1 |
| openSUSE Leap 15.2 | nodejs12 | 12.22.7-lp152.3.21.1 | openSUSE-SU-2021:1574-1 |
| openSUSE Leap 15.2 | nodejs14 | 14.18.1-lp152.17.1 | openSUSE-SU-2021:1552-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | nodejs | 14.17.6-r0 | — |
| Alpine v3.23 | nodejs | 14.17.6-r0 | — |
| Alpine v3.22 | nodejs | 14.17.6-r0 | — |
| Alpine v3.21 | nodejs | 14.17.6-r0 | — |
| Alpine v3.20 | nodejs | 14.17.6-r0 | — |
Show 9 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | nodejs | 14.17.6-r0 | — |
| Alpine v3.18 | nodejs | 14.17.6-r0 | — |
| Alpine v3.17 | nodejs | 14.17.6-r0 | — |
| Alpine v3.16 | nodejs | 14.17.6-r0 | — |
| Alpine v3.15 | nodejs | 14.17.6-r0 | — |
| Alpine v3.14 | nodejs | 14.17.6-r0 | — |
| Alpine v3.13 | nodejs | 14.17.6-r0 | — |
| Alpine v3.12 | nodejs | 12.22.6-r0 | — |
| Alpine v3.11 | nodejs | 12.22.6-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | tar | < 4.4.18 | 4.4.18 | GHSA-5955-9wpr-37jh |
| npm | tar | >= 5.0.0, < 5.0.10 | 5.0.10 | GHSA-5955-9wpr-37jh |
| npm | tar | >= 6.0.0, < 6.1.9 | 6.1.9 | GHSA-5955-9wpr-37jh |
Advisories 18
- WID-SEC-2022-1603 IBM Tivoli Netcool/OMNIbus: Mehrere Schwachstellen BSI CERT-Bund (WID) · Mar 24, 2026
- openSUSE-SU-2021:1574-1 Security update for nodejs12 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:3940-1 Security update for nodejs12 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:3964-1 Security update for nodejs14 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2021:1552-1 Security update for nodejs14 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2021:3886-1 Security update for nodejs14 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:0101-1 Security update for nodejs12 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:11616-1 nodejs14-14.18.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- FSA-202302 Festo: Several vulnerabilities in FactoryViews CERT@VDE · Feb 2, 2026
- openSUSE-SU-2021:3940-1 Security update for nodejs12 SUSE / openSUSE Security Updates · May 7, 2025
- openSUSE-SU-2021:3964-1 Security update for nodejs14 SUSE / openSUSE Security Updates · May 7, 2025
- ICSA-22-069-09 Siemens SINEC INS CISA ICS & IT advisories · May 6, 2025
- WID-SEC-2024-1591 Juniper JUNOS: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 11, 2024
- WID-SEC-2022-0092 Node.js: Mehrere Schwachstellen ermöglichen Manipulation von Dateien BSI CERT-Bund (WID) · May 9, 2024
- WID-SEC-2023-0809 IBM QRadar SIEM: Mehrere Schwachstellen BSI CERT-Bund (WID) · Feb 19, 2024
- WID-SEC-2023-0857 IBM QRadar SIEM: Mehrere Schwachstellen BSI CERT-Bund (WID) · Apr 4, 2023
- WID-SEC-2023-0856 IBM QRadar SIEM: Mehrere Schwachstellen BSI CERT-Bund (WID) · Apr 4, 2023
- SSA-389290 SSA-389290: Third-Party Component Vulnerabilities in SINEC INS Siemens ProductCERT · Mar 8, 2022