Skip to content
Heist/ feed
Back to feed
HighFix available

nodejs — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2021-37701

The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. 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, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would r

Products
nodejs
Affected versions
Not specified
Fixed versions
12.22.6-r0, 14.17.6-r0
CVEs
CVE-2021-37701
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 22:06 UTC · Revision 1

Source evidence

ALPINE-CVE-2021-37701

core-osv · Original source

Published 31 Aug 2021, 17:15 UTC

The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. 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, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would r

osv:ALPINE-CVE-2021-37701

nodejs

Fixed versions: 12.22.6-r0

nodejs

Fixed versions: 12.22.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

nodejs

Fixed versions: 14.17.6-r0

Complete source record
{
  "id": "591d7add2a91ab5d6daa8efb5691f52d29f77a2b1d70640728bfc39682336ce6",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2021-37701",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2021-37701",
    "summary": "The npm package \"tar\" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. 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, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\\` and `/` characters as path separators, however `\\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would r",
    "evidence": "osv:ALPINE-CVE-2021-37701",
    "products": [
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "12.22.6-r0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "12.22.6-r0",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/4/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/5/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/6/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/7/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/8/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/9/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/9/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/10/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/10/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/11/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/11/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/12/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/12/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "nodejs",
          "evidence": "/affected/13/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "14.17.6-r0",
            "evidence": "/affected/13/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "ALPINE-CVE-2021-37701",
      "aliases": [
        "ALPINE-CVE-2021-37701"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "12.22.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.11"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "12.22.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.15"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.16"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.17"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.18"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.19"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.20"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.21"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.22"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.23"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "14.17.6-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "nodejs",
            "purl": "pkg:apk/alpine/nodejs?arch=source",
            "ecosystem": "Alpine:v3.24"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-37701.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-23T17:17:56.204278856Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-37701"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2021-37701"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-37701",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 415515,
  "published_at": "2021-08-31T17:15:07.963+00:00"
}