Trivy Node scan can't parse package.json when latest
is used as a package version
#6747
Closed
2 tasks done
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Discussed in #6730
Originally posted by abrwn May 20, 2024
Description
When running a trivy scan on a node project, the following warning is shown when a
latest
version is used for a dependency:Unable to parse "package.json" to remove dev dependencies: unable to walk dependencies: unable to match version for <package>
Example:
package.json
yarn.lock
Since
latest
is a valid version, should trivy be able to parse this?Desired Behavior
Trivy scanner is able to parse
latest
version in package.jsonActual Behavior
Node scan can't parse package.json when
latest
is used as a package version, and therefore can't ignore dev dependencies.Reproduction Steps
Target
Filesystem
Scanner
Vulnerability
Output Format
Table
Mode
Standalone
Debug Output
Operating System
linux
Version
Installed using `curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.50.2`
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: