Hi @Manish2481983 thanks so much for the report!
I’m trying to understand exactly what you’re seeing. I think you are running grype
on public GitLab CE images from dockerhub, like this:
grype gitlab/gitlab-ce:17.5.0-ce.0
And you’re surprised to see that some critical CVEs are present in several versions, specifically gitlab/gitlab-ce:17.3.6-ce.0
, gitlab/gitlab-ce:17.4.3-ce.0
, and gitlab/gitlab-ce:17.5.1-ce.0
from https://hub.docker.com/r/gitlab/gitlab-ce/tags. Is that right? The rest of my answer assumes that’s what you’re doing, so let me know if I got that wrong 
I think you have a couple of questions:
- Are these critical vulnerabilities, especially CVE-2021-23369 really present?
- What do the warnings like
WARN could not match by package language
mean? Do they mean the critical vulns are false positives?
I’ll start with the warnings:
[0002] WARN could not match by package language (package=Pkg(type=gem, name=gitlab-security_report_schemas, version=0.1.2.min15.0.0.max15.2.0, upstreams=0)): matcher failed to parse version pkg=“gitlab-security_report_schemas” ver=“0.1.2.min15.0.0.max15.2.0”: unable to create semver obj: Malformed version: 0.1.2.min15.0.0.max15.2.0
This means that Grype found package that looks like a Ruby Gem but that has a version Grype can’t understand how to compare, namely 0.1.2.min15.0.0.max15.2.0
. There are no matches on that package, or on the other packages producing this warning, so this is not the cause of any false positives.
False Positives
I think there are false positives in the image, because Syft is finding the package.json
files from VS Code extensions and treating them like NPM packages.
Taking a look at Remote code execution in handlebars when compiling templates · CVE-2021-23369 · GitHub Advisory Database · GitHub, this vulnerability is against the NPM package handlebars
, but not the VS Code extension. Let’s run Syft on the image to see what it finds:
❯ 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"
❯ head handlebars.json
{
"name": "handlebars",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "0.10.x"
},
So it looks like Syft is seeing the package.json
that is part of the VS Code extension for working on handlebars files, and thinking it is from the NPM package of the same name, which would be vulnerable to this CVE in version 1.0.0, so that particular vulnerability (CVE-2021-23369) is a false positive.
I’ll open a bug in Syft for this an post a link in a moment.