rust: path dependencies: in-repo crates incorrectly being detected and fallbacks to upstream crates.io
packages even though path
s specified, leading Grype detects FP vulnerabilities for Rust
#3598
Labels
bug
Something isn't working
What happened:
Syft is incorrectly detecting an in-repo
telemetry
crate as thecrates.io
telemetry crate, though they are completely distinct codebases.zed project uses lots of path dependencies and Syft doesn't respect to Rust's path dependencies context.
There is a confusion between local crate vs crates.io's crate, those are different packages and
zed
uses its owntelemetry
package as it has overridden in theCargo.toml
.Eventually, Grype detects it as a vulnerable dependency, which is not correct.
What you expected to happen:
Syft should respect Rust's Path Dependencies that defined in the
Cargo.toml
. And also check thesource
s:"source": "local"
"source": "crates.io"
Steps to reproduce the issue:
git clone git@github.com:zed-industries/zed.git --depth 1
cd zed
syft . | grep telemetry
rust-crate
(wrong)grype . | grep telemetry
telemetry 0.1.0 0.1.3 rust-crate GHSA-hpcx-3pw8-g3j2 Critical
Anything else we need to know?:
I'm not familiar with
Cargo.toml
context but I think this override would be a proof of it doesn't usecrates.io
fortelemetry
package.Please check the issue title if it clearly represents what the actual issue is; and feel free to edit!
Environment:
syft version
:1.18.1
(latest as of now)cat /etc/os-release
or similar):macOS 15.2
The text was updated successfully, but these errors were encountered: