Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Security upgrade node-gyp from 7.1.2 to 8.4.1 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

terrorizer1980
Copy link
Owner

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to fix one or more vulnerable packages in the `npm` dependencies of this project.

merge advice

Changes included in this PR

  • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
    • package.json
    • package-lock.json

Vulnerabilities that will be fixed

With an upgrade:
Severity Priority Score (*) Issue Breaking Change Exploit Maturity
high severity 696/1000
Why? Proof of Concept exploit, Has a fix available, CVSS 7.5
Regular Expression Denial of Service (ReDoS)
SNYK-JS-ANSIREGEX-1583908
Yes Proof of Concept

(*) Note that the real score may have changed since the PR was raised.

Commit messages
Package name: node-gyp The new version differs by 137 commits.
  • f5fa6b8 chore: release 8.4.1
  • cc37b88 fix: windows command missing space (#2553)
  • 8083f6b deps: [email protected]
  • 787cf7f docs: fix typo in powershell node-gyp update
  • 7073c65 chore: release 8.4.0
  • a27dc08 feat: build with config.gypi from node headers
  • 5a00387 feat: support vs2022 (#2533)
  • fb85fb2 chore: release 8.3.0
  • 5585792 feat(gyp): update gyp to v0.10.0 (#2521)
  • b05b4fe chore(deps): bump make-fetch-happen from 8.0.14 to 9.1.0
  • 0a67dcd test: Python 3.10 was release on Oct. 4th (#2504)
  • f2ad87f chore: refactor the creation of config.gypi file
  • bc47cd6 chore: release 8.2.0
  • ed9a9ed feat(gyp): update gyp to v0.9.6 (#2481)
  • 660dd7b doc: correct link to "binding.gyp files out in the wild" (#2483)
  • ec15a3e chore(deps): bump tar from 6.1.0 to 6.1.2 (#2474)
  • 78361b3 ISSUE_TEMPLATE.md: Instructions for old versions (#2470)
  • f0882b1 fix: missing spaces
  • c8c0af7 fix: doc how to update node-gyp independently from npm
  • b6e1cc7 Add title to node-gyp version document (#2452)
  • b7bccdb ci: GitHub Actions Test on node: [12.x, 14.x, 16.x] (#2439)
  • 161c235 doc(wiki): safer doc names, remove unnecessary TypedArray doc
  • b52e487 doc(wiki): link to docs/ from README
  • f0a4835 doc(wiki): move wiki docs into doc/

See the full diff

Check the changes in this PR to ensure they won't cause issues with your project.


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report

🛠 Adjust project settings

📚 Read more about Snyk's upgrade and patch logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

@@ -45,7 +45,7 @@
"got": "^11.7.0",
"lzma-native": "^8.0.1",
"node-abi": "^2.19.2",
"node-gyp": "^7.1.0",
"node-gyp": "^8.4.1",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical OSS Vulnerability:

pkg:npm/[email protected]

7 Critical, 0 Severe, 0 Moderate, 0 Unknown vulnerabilities have been found across 3 dependencies

Components
    pkg:npm/[email protected]
      CRITICAL Vulnerabilities (1)

        [sonatype-2021-1169] Unknown

        ansi-regex - Regular Expression Denial of Service (ReDoS) [CVE-2021-3807]

        CVSS Score: 7.5

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

        CWE: CWE-1333

    pkg:npm/[email protected]
      CRITICAL Vulnerabilities (5)
        CVE-2021-37701

        [CVE-2021-37701] CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

        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 remove the directory from the filesystem, but not from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the FOO directory would then be placed in the target of the symbolic link, thinking that the directory had already been created. These issues were addressed in releases 4.4.16, 5.0.8 and 6.1.7. 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. If this is not possible, a workaround is available in the referenced GHSA-9r2w-394v-53qc.

        CVSS Score: 8.6

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

        CWE: CWE-22

        CVE-2021-37712

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

        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 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 names containing unicode values that normalized to the same value. Additionally, on Windows systems, long path portions would resolve to the same file system entities as their 8.3 "short path" counterparts. A specially crafted tar archive could thus include a directory with one form of the path, followed by a symbolic link with a different string that resolves to the same file system entity, followed by a file using the first form. By first creating a directory, and then replacing that directory with a symlink that had a different apparent name that resolved to the same entry in the filesystem, 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. 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. If this is not possible, a workaround is available in the referenced GHSA-qq89-hq3f-393p.

        CVSS Score: 8.6

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

        CWE: CWE-22

        CVE-2021-32803

        [CVE-2021-32803] CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

        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.

        CVSS Score: 8.1

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

        CWE: CWE-22

        CVE-2021-32804

        [CVE-2021-32804] CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

        The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the preservePaths flag is not set to true. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example /home/user/.bashrc would turn into home/user/.bashrc. This logic was insufficient when file paths contained repeated path roots such as ////home/user/.bashrc. node-tar would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. ///home/user/.bashrc) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. Users may work around this vulnerability without upgrading by creating a custom onentry method which sanitizes the entry.path or a filter method which removes entries with absolute paths. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.

        CVSS Score: 8.1

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

        CWE: CWE-22

        sonatype-2021-0914

        [sonatype-2021-0914] CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustion')

        tar - Regular Expression Denial of Service (ReDoS)

        The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.

        CVSS Score: 7.5

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

        CWE: CWE-400

    pkg:npm/[email protected]
      CRITICAL Vulnerabilities (1)

        [sonatype-2021-4879] Unknown

        minimatch - Regular Expression Denial of Service (ReDoS)

        CVSS Score: 7.5

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

        CWE: CWE-1333

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants