missing git-only Cargo dependencies in the production graph #11236
ardentperf
started this conversation in
Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
ran into this while creating SBOMs for paradedb oss software. AI generated summary:
Trivy's Cargo analyzer drops direct dependencies declared with a git source
when the dependency has no explicit Cargo version constraint. This causes the
dependency and its transitive dependencies to be absent from vulnerability
results and generated SBOMs, even though they are present in
Cargo.lockandare compiled into the application.
This is particularly visible with Cargo workspaces. Trivy 0.69.0 correctly
handles workspace-inherited package versions, but still omits git-only
dependencies such as:
Desired Behavior
For the reproduction above, Trivy's Cargo result and generated SPDX should
include:
No change is expected for packages that are only present in
Cargo.lockasdev dependencies.
Actual Behavior
missing
Reproduction Steps
The application uses the crate at runtime:
Scan the resulting builder image with Trivy 0.69.0:
The
build/Cargo.locktarget containspg_search, but does not containtantivy-fstor its transitive dependencyutf8-ranges. A Cargo SBOM builtfrom
cargo metadata/CycloneDX contains both packages, including the gitcommit in the PURL:
Operating System
Linux
Version
All reactions