CVE Vulnerabilities

CVE-2021-32803

Improper Link Resolution Before File Access ('Link Following')

Published: Aug 03, 2021 | Modified: Jul 02, 2022
CVSS 3.x
8.1
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
CVSS 2.x
5.8 MEDIUM
AV:N/AC:M/Au:N/C:N/I:P/A:P
RedHat/V2
RedHat/V3
8.1 MODERATE
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Ubuntu
MEDIUM

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.

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

Name Vendor Start Version End Version
Tar Tar_project * 3.2.3 (excluding)
Tar Tar_project 4.0.0 (including) 4.4.15 (excluding)
Tar Tar_project 5.0.0 (including) 5.0.7 (excluding)
Tar Tar_project 6.0.0 (including) 6.1.2 (excluding)
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-grafana-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-must-gather-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-operator-bundle-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat application-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat assisted-image-service-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cert-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-backup-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat clusterclaims-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-curator-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat clusterlifecycle-state-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-proxy-addon-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat config-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat console-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat console-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat discovery-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat endpoint-monitoring-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-propagator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-spec-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-status-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-template-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grafana-dashboard-loader-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grc-ui-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grc-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat iam-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat insights-client-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat insights-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-addon-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-addon-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-operator-bundle-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat kube-rbac-proxy-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat kube-state-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat managedcluster-import-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat management-ingress-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat memcached-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat memcached-exporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat metrics-collector-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicloud-integrations-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicloud-manager-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multiclusterhub-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multiclusterhub-repo-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-observability-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-application-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-channel-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-deployable-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-placementrule-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-subscription-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-subscription-release-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat node-exporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat observatorium-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat observatorium-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat openshift-hive-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat placement-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat prometheus-alertmanager-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat prometheus-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat provider-credential-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rbac-query-proxy-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat redisgraph-tls-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat registration-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat registration-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-agent-service-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-agent-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-reporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-aggregator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-collector-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat submariner-addon-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat thanos-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat thanos-receive-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-rclone-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-restic-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-rsync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat work-container *
Red Hat Enterprise Linux 8 RedHat nodejs:12-8040020210817133458.522a0ee4 *
Red Hat Enterprise Linux 8 RedHat nodejs:14-8040020210817165654.522a0ee4 *
Red Hat Enterprise Linux 8.1 Extended Update Support RedHat nodejs:12-8010020210817113128.c27ad7f8 *
Red Hat Enterprise Linux 8.2 Extended Update Support RedHat nodejs:12-8020020210817125332.4cda2c84 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/cephcsi-rhel8:4.9-164.57484e3.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/ocs-must-gather-rhel8:4.9-257.4181add.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/ocs-operator-bundle:4.9.0-5 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/ocs-rhel8-operator:4.9-257.4181add.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odf-console-rhel8:4.9-39.0f2fa23.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odf-multicluster-operator-bundle:4.9.0-5 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odf-multicluster-rhel8-operator:4.9-30.007b3d8.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odf-operator-bundle:4.9.0-5 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odf-rhel8-operator:4.9-59.c8bbc1f.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odr-cluster-operator-bundle:4.9.0-5 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odr-hub-operator-bundle:4.9.0-5 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/odr-rhel8-operator:4.9-27.3d037cc.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/rook-ceph-rhel8-operator:4.9-219.c3f67c6.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf4/volume-replication-rhel8-operator:4.9-28.82f68db.release_4.9 *
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8 RedHat odf/odf-multicluster-rhel8-operator:4.9-30.007b3d8.release_4.9 *
Red Hat Software Collections for Red Hat Enterprise Linux 7 RedHat rh-nodejs14-nodejs-0:14.17.5-1.el7 *
Red Hat Software Collections for Red Hat Enterprise Linux 7 RedHat rh-nodejs12-nodejs-0:12.22.5-1.el7 *
Red Hat Software Collections for Red Hat Enterprise Linux 7 RedHat rh-nodejs12-nodejs-nodemon-0:2.0.3-5.el7 *
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS RedHat rh-nodejs14-nodejs-0:14.17.5-1.el7 *
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS RedHat rh-nodejs12-nodejs-0:12.22.5-1.el7 *
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS RedHat rh-nodejs12-nodejs-nodemon-0:2.0.3-5.el7 *
Node-tar Ubuntu esm-apps/focal *
Node-tar Ubuntu hirsute *
Node-tar Ubuntu trusty *
Node-tar Ubuntu upstream *
Node-tar Ubuntu xenial *

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References