PT-2021-5776

CVE-2021-32803

·

Published

2021-07-27

·

Updated

2026-10-07

Description by

CVSS 3.1
8.2
High
MetricsAV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
Name of the Vulnerable Software and Affected Versions node-tar versions prior to 3.2.3 node-tar versions prior to 4.4.15 node-tar versions prior to 5.0.7 node-tar versions prior to 6.1.2
Description The issue is related to insufficient symlink protection in the node-tar module for handling tar archives. This allows an attacker to bypass symlink checks on directories, enabling arbitrary file creation and overwrite. The vulnerability can be exploited by creating a directory and then replacing it with a symlink, thus allowing an untrusted tar file to extract arbitrary files into an arbitrary location.
Recommendations For versions prior to 3.2.3, update to version 3.2.3 or later. For versions prior to 4.4.15, update to version 4.4.15 or later. For versions prior to 5.0.7, update to version 5.0.7 or later. For versions prior to 6.1.2, update to version 6.1.2 or later. As a temporary workaround, consider creating a custom filter method to prevent the extraction of symbolic links, such as:
js
const tar = require('tar')
tar.x({
 file: 'archive.tgz',
 filter: (file, entry) => {
  if (entry.type === 'SymbolicLink') {
   return false
  } else {
   return true
  }
 }
})
Exploitability
Fix
Impacts
Vendors
Affected products
Related identifiers
GHSA-R628-MHMH-QJHW
ALSA-2021:3623
ALSA-2021:3666
ALT-PU-2021-2920
ALT-PU-2021-2921
ALT-PU-2021-3615
ALT-PU-2022-1798
ALT-PU-2022-3069
ALT-PU-2022-3073
CESA-2021_3623
CESA-2021_3666
MGASA-2022-0103
OPENSUSE-SU-2022:0657-1
OPENSUSE-SU-2022_0657-1
OPENSUSE-SU-2022:0704-1
OPENSUSE-SU-2022_0704-1
OPENSUSE-SU-2022:0715-1
OPENSUSE-SU-2022_0715-1
OPENSUSE-SU-2022_1717-1
RHSA-2021:3280
RHSA-2021:3281
RHSA-2021:3623
RHSA-2021_3623
RHSA-2021:3638
RHSA-2021:3639
RHSA-2021:3666
RHSA-2021_3666
RLSA-2021:3623
RLSA-2021:3666
SUSE-SU-2022:0531-1
SUSE-SU-2022:0563-1
SUSE-SU-2022:0569-1
SUSE-SU-2022:0570-1
SUSE-SU-2022:0657-1
SUSE-SU-2022:0704-1
SUSE-SU-2022:0715-1
SUSE-SU-2022:1717-1
SUSE-SU-2022_1717-1
USN-5283-1
Found an issue in the description? Have something to add? Feel free to write us 👾