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

bug: stop reporting VSCode extensions as NPM packages #3381

Open
willmurphyscode opened this issue Oct 24, 2024 · 0 comments
Open

bug: stop reporting VSCode extensions as NPM packages #3381

willmurphyscode opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working needs-investigation

Comments

@willmurphyscode
Copy link
Contributor

What happened:

For some images, if there are vscode extensions presents, these extensions leave a package.json that is shaped somewhat like NPM's package.json on the file system. Syft finds these package.jsons and reports them as NPM packages. However, they are not NPM packages; they are VS Code extensions.

What you expected to happen:

Syft should emit VS Code extension packages, or at least not emit NPM packages, for things that are clearly VS Code extensions.

Steps to reproduce the issue:

Note: this image is 1.3 GB and these repro steps are slowwww.

❯ syft -q gitlab/gitlab-ce:17.4.3-ce.0  | grep handlebars
handlebars                                                                   1.0.0                                                   npm                             
❯ syft -o json gitlab/gitlab-ce:17.4.3-ce.0 > gitlab.17.4.3-ce.0.syft.json
❯ cat gitlab.17.4.3-ce.0.syft.json| jq '.artifacts[] | select(.name == "handlebars") | .locations[] | .path'
"/opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack/gitlab-vscode/0.0.1-dev-20240909013227/vscode/extensions/handlebars/package.json"
❯ docker run gitlab/gitlab-ce:17.4.3-ce.0 \
cat /opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack/gitlab-vscode/0.0.1-dev-20240909013227/vscode/extensions/handlebars/package.json | \
jq .repository.url   
"https://github.com/microsoft/vscode.git"

So Syft is claiming that https://www.npmjs.com/package/handlebars is present at version 1.0.0 (which has a critical vuln), but really VS Code's builtin Handlebars Extension is present.

Anything else we need to know?:

  • This was reported because it causes false positives in Grype because the handlebars VS Code extension has a lower version than the NPM handlebars package.
  • Reported on discourse

Environment:

  • Output of syft version:
  • OS (e.g: cat /etc/os-release or similar):
@willmurphyscode willmurphyscode added the bug Something isn't working label Oct 24, 2024
@willmurphyscode willmurphyscode moved this to Backlog in OSS Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-investigation
Projects
Status: Backlog
Development

No branches or pull requests

1 participant