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

posibility of a 5.0.3 release with less strict node-gyp version dependency #1493

Closed
paimon0715 opened this issue Aug 24, 2021 · 20 comments
Closed
Assignees

Comments

@paimon0715
Copy link

paimon0715 commented Aug 24, 2021

Hi, @kewde , there are two high severity vulnerabilities introduced by tar@2.2.2:

Issue Description

I noticed that a vulnerability is introduced in sqlite3@5.0.2:
Vulnerability CVE-2021-32804 and CVE-2021-32803 (high severity) affects package tar (versions:<3.2.2,>=4.0.0 <4.4.14,>=5.0.0 <5.0.6,>=6.0.0 <6.1.1): https://snyk.io/vuln/SNYK-JS-TAR-1536531 and https://snyk.io/vuln/SNYK-JS-TAR-1536528
The above vulnerable package is referenced by sqlite3@5.0.2 via:
sqlite3@5.0.2 ➔ node-gyp@3.8.0 ➔ tar@2.2.2

Since sqlite3@5.0.2 (214,273 downloads per week) is referenced by 8,775 downstream projects (e.g., websql 2.0.2 (latest version), @sap/cds-dk 4.4.1 (latest version), typeorm-model-generator 0.4.5 (latest version), ueberdb2 1.4.13 (latest version), indexeddbshim 8.0.0 (latest version)), the above vulnerabilities can be propagated into these downstream projects and expose security threats to them via the following package dependency paths:
(1)@grouparoo/core@0.5.2 ➔ sqlite3@5.0.2 ➔ node-gyp@3.8.0 ➔ tar@2.2.2
(2)@contrast/test-bench-utils@3.20.1-alpha.0 ➔ sqlite3@5.0.2 ➔ node-gyp@3.8.0 ➔ tar@2.2.2
......

If sqlite3@5.0.* removes the vulnerable package from the above version, then its fixed version can help downstream users decrease their pain.

Given the large number of downstream users, could you help update your package to remove the vulnerability from sqlite3@5.0.2 ?

Fixing suggestions

In sqlite3@5.0.3, maybe you can kindly try to perform the following upgrade :
node-gyp 3.x ➔ ^4.0.0;

Note:
node-gyp@4.0.0(>=4.0.0) directly depends on tar@4.4.19 which has fixed the vulnerability CVE-2021-32804 and CVE-2021-32803.

Thank you for your attention to this issue and welcome to share other ways to resolve the issue.

Best regards,
^_^

@Trinovantes
Copy link

Trinovantes commented Aug 25, 2021

There doesn't seem to be any breaking changes in node-gyp from 3.x to its latest version ^8 (at least for node-sqlite3 specifically). I resolved the security warnings by explicitly adding this to my package.json (using yarn)

"resolutions": {
  "node-gyp": "^8"
}

@tom-oxmt
Copy link

Hello. This vulnerability of the tar package is becoming troublesome. Could you please update your dependencies to a newer version of tar? Thanks

@unuseless
Copy link

Looking forward to a fix for the tar dependency.

@introspection3
Copy link

node-gyp the version is too low! this effects other packages,it like a cancer

@ghost
Copy link

ghost commented Sep 25, 2021

Please update node-gyp version, security should not be taken lightly.

@teklakct
Copy link

@564064202 @sharedrory it is updated already but only on master/main branch. There is no new tagged version released yet.
You can specify a "fix" commit if you want. Simply add this to your dependencies in package.json

"sqlite3": "git@github.com:mapbox/node-sqlite3.git#3fb3715c4e699ca3bc19e47b136758c66f61e477",

@ghost
Copy link

ghost commented Sep 27, 2021

@teklakct Thank you. I looked at the commit history and since the current release there have been some bug fixes and the (pre)node-gyp update. While your suggestion works, I think something like a vulnerability fix requires its own emergency release.

@teklakct
Copy link

Yes, it should but I cannot wait so we decide to specify commit instead

@ghost
Copy link

ghost commented Sep 27, 2021

Oh sorry I wasn't clear. Yes people that want to have it fixed asap should use that method (or fork) but I meant its the developers/maintainers responsibility to keep the dependencies up-to-date.

rhansen added a commit to ether/ueberDB that referenced this issue Sep 28, 2021
sqlite3 is fetched from GitHub because the maintainers haven't yet
published a node-gyp update to npm:
TryGhost/node-sqlite3#1493
@introspection3
Copy link

please publish to npm

@paridhi-agr
Copy link

paridhi-agr commented Sep 30, 2021

Hi @kewde, @inukshuk , would request you to please release this fix in 5.0.2 revision. It is causing high severity vulnerabilities. Thanks!

JohnMcLear pushed a commit to ether/ueberDB that referenced this issue Oct 2, 2021
sqlite3 is fetched from GitHub because the maintainers haven't yet
published a node-gyp update to npm:
TryGhost/node-sqlite3#1493
@kewde kewde self-assigned this Oct 12, 2021
@rufreakde
Copy link

Will the fix be published soon?

@rickbergfalk
Copy link

rickbergfalk commented Nov 25, 2021

Haven't tried it yet, but it seems vscode folks published a fork with security fixes

https://www.npmjs.com/package/@vscode/sqlite3
https://github.com/microsoft/vscode-node-sqlite3

@davedoesdev
Copy link
Contributor

@rickbergfalk thanks for the heads up, it works for me. I also learned about npm aliases which made it easier to switch:

    "sqlite3": "npm:@vscode/sqlite3@^5.0.7",

@josep11
Copy link

josep11 commented Dec 4, 2021

@rickbergfalk thanks for the heads up, it works for me. I also learned about npm aliases which made it easier to switch:

    "sqlite3": "npm:@vscode/sqlite3@^5.0.7",

Tried this one and works perfectly fine for me.
But just for you to beware it depends on Python >= 3.6.0. I noticed it on CircleCI builds.

@kirillgroshkov
Copy link

please publish master to npm! 🙏

bhj added a commit to bhj/KaraokeEternal that referenced this issue Dec 21, 2021
gnprice added a commit to zulip/zulip-mobile that referenced this issue Jan 11, 2022
In particular this leads to using a reasonably recent `tar` package,
fixing vulnerabilities in the old one it was using.

Upstream has already bumped this to node-gyp 7.x in their master
branch, but haven't posted a release to NPM:
  TryGhost/node-sqlite3#1493

Empirically node-gyp 8.x, the latest, works fine.  That's also
reported by someone on that issue thread:
  TryGhost/node-sqlite3#1493 (comment)
May as well go for that, then.  (There was no 8.x yet when the
version specified in sqlite3 was bumped to 7.x.)

Some other people on that thread report using a fork made by the
VS Code developers, which posted some releases in November.  But
that fork seems pretty clearly intended for VS Code's own internal
use, with no promises for broader consumption:
  microsoft/vscode-node-sqlite3#14 (comment)
so that doesn't seem like an improvement over upstream.
sumj25 pushed a commit to sumj25/zulip-mobile that referenced this issue Jan 12, 2022
In particular this leads to using a reasonably recent `tar` package,
fixing vulnerabilities in the old one it was using.

Upstream has already bumped this to node-gyp 7.x in their master
branch, but haven't posted a release to NPM:
  TryGhost/node-sqlite3#1493

Empirically node-gyp 8.x, the latest, works fine.  That's also
reported by someone on that issue thread:
  TryGhost/node-sqlite3#1493 (comment)
May as well go for that, then.  (There was no 8.x yet when the
version specified in sqlite3 was bumped to 7.x.)

Some other people on that thread report using a fork made by the
VS Code developers, which posted some releases in November.  But
that fork seems pretty clearly intended for VS Code's own internal
use, with no promises for broader consumption:
  microsoft/vscode-node-sqlite3#14 (comment)
so that doesn't seem like an improvement over upstream.
@ThePeterMick
Copy link

Any updates when this pkg will be update?

Apparently the fix was in 3fb3715

davidmehren added a commit to hedgedoc/hedgedoc that referenced this issue Mar 5, 2022
Microsoft maintains a fork of the sqlite3 package at
https://github.com/microsoft/vscode-node-sqlite3

Switching to that allows us to drop various very old dependencies,
removing 5 high security alerts in the process.

References:
TryGhost/node-sqlite3#1493 (comment)
Signed-off-by: David Mehren <git@herrmehren.de>
davidmehren added a commit to hedgedoc/hedgedoc that referenced this issue Mar 6, 2022
Microsoft maintains a fork of the sqlite3 package at
https://github.com/microsoft/vscode-node-sqlite3

Switching to that allows us to drop various very old dependencies,
removing 5 high security alerts in the process.

References:
TryGhost/node-sqlite3#1493 (comment)
Signed-off-by: David Mehren <git@herrmehren.de>
davidmehren added a commit to hedgedoc/hedgedoc that referenced this issue Mar 7, 2022
Microsoft maintains a fork of the sqlite3 package at
https://github.com/microsoft/vscode-node-sqlite3

Switching to that allows us to drop various very old dependencies,
removing 5 high security alerts in the process.

References:
TryGhost/node-sqlite3#1493 (comment)
Signed-off-by: David Mehren <git@herrmehren.de>
@the1corndog
Copy link

the1corndog commented Mar 23, 2022

Hello,

Is there a reason why this vulnerability fix hasn't been released yet? Seems the problem was resolved in the code base?

Thank you

daniellockyer added a commit that referenced this issue Apr 12, 2022
refs #1493
refs nodejs/node-gyp#2474

- `node-gyp` 7.x has a minimum `tar` version of 6.0.2, which has a
  security vulnerability listed against it
- `node-gyp` 8.x updates the minimum to 6.1.2, which contains the fix
- `node-gyp` 8.x should still allow us to use Node 10, so we're good
  with Node compatibility
- it also seems to fix the `PYTHON` env variable being set, which helps
  fix the build for MacOS Monterey (coming in the next commit)
daniellockyer added a commit that referenced this issue Apr 12, 2022
refs #1493
refs nodejs/node-gyp#2474

- `node-gyp` 7.x has a minimum `tar` version of 6.0.2, which has a
  security vulnerability listed against it
- `node-gyp` 8.x updates the minimum to 6.1.2, which contains the fix
- `node-gyp` 8.x should still allow us to use Node 10, so we're good
  with Node compatibility
- it also seems to fix the `PYTHON` env variable being set, which helps
  fix the build for MacOS Monterey (coming in the next commit)
@daniellockyer
Copy link
Member

sqlite3 v5.0.3 has been shipped 🙂

@kberg
Copy link

kberg commented Apr 17, 2022

Thanks @daniellockyer!

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

No branches or pull requests