Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. tar
  4. ›
  5. CVE-2021-37712

CVE-2021-37712: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

August 31, 2021 (updated February 23, 2023)

The npm package “tar” (aka node-tar) 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.

References

  • github.com/npm/node-tar/security/advisories/GHSA-qq89-hq3f-393p
  • nvd.nist.gov/vuln/detail/CVE-2021-37712
  • www.npmjs.com/package/tar
  • www.oracle.com/security-alerts/cpuoct2021.html

Code Behaviors & Features

Detect and mitigate CVE-2021-37712 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions up to 4.4.17, all versions starting from 5.0.0 up to 5.0.9, all versions starting from 6.0.0 up to 6.1.8

Fixed versions

  • 4.4.18
  • 5.0.10
  • 6.1.9

Solution

Upgrade to versions 4.4.18, 5.0.10, 6.1.9 or above.

Impact 8.6 HIGH

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

npm/tar/CVE-2021-37712.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:37 +0000.