`cves` command detects incorrect version (`0.0.0`) of a `devDependency` for a Node-based image
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 141
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
👋 Hello Docker Scout team!
We have just found interesting behaviour when using command: cves on a Node-based image. For devDependencies Scout determines the used versions of the packages as 0.0.0.
Of course this version is very low and a dependency is marked vulnerable to every vulnerability ever discovered in the package.
These dependencies are not actually present in the image.
This seems to only happen in github actions, not in CLI or docker desktop.
This seems to happen only when analyzing an image that has the sbom.
Example
We are using concurrently (npm) to run a couple of scripts in a local development environment. We are not using it in production.
package.json:
...
"scripts": {
"dev": "concurrently --raw ...",
...
},
"dependencies": {
...
},
"devDependencies": {
...
"concurrently": "^8.2.2",
...
}
This means concurrently is showing up in our yarn.lock
concurrently@^8.2.2:
version "8.2.2"
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.2.tgz#353141985c198cfa5e4a3ef90082c336b5851784"
integrity sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==
dependencies:
chalk "^4.1.2"
date-fns "^2.30.0"
lodash "^4.17.21"
rxjs "^7.8.1"
shell-quote "^1.8.1"
spawn-command "0.0.2"
supports-color "^8.1.1"
tree-kill "^1.2.2"
yargs "^17.7.2"
concurrently depends on shell-quote, which had two critical vulnerabilities in past
- critical 9.8: CVE-2016-10541, Affected range <1.6.1
- critical 9.8: CVE-2021-42740, Affected range <=1.7.2
In our case
- we actually don't have
shell-quotein our final image, it's only adevDependency - if we did, we specify
shell-quote1.8.1where both vulnerabilities are fixed
SBOM?
Interestingly enough, this only happens with images that have been built with sbom: true (docker/build-push-action@v5). If the image does not have the sbom attached, these dependencies do not show up in the output (correct).
As a workaround I disabled SBOM generation in our build pipeline. This is not nice of course.
I remember reading somewhere that sbom generation differs between scout and buildkit, can this be related?
Happy to provide more info if needed. Please feel free to reach out!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the cves command in GitHub Actions with an image built using docker/build-push-action@v5 and sbom: true, then compare it with CLI output and an image without an attached SBOM. Done means devDependency versions are not reported as 0.0.0 and dependencies absent from the final image are not incorrectly flagged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, github-actions, javascript, node.js
- Domain
- ci-cd, devops, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100