You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Cargo [dependencies.<crate>] sub-tables are ignored by vg scan #546
Cargo lets a dependency be written as its own table:
[dependencies.serde]
version = "1.0"features = ["derive"]
[dev-dependencies.criterion]
version = "0.5"
cargoDependencyHeader in src/core-open/scanners/rust-scanner.ts documents that any header other than the dependency tables themselves, "including [dependencies.<crate>]", is not a dependency table, and gap 8 in docs/sbom-dependency-scope.md confirms the sub-table form is not parsed. Crates declared this way are missing from vg scan drift results and from vg sbom export direct rows. The form is common in larger workspaces and generated manifests.
What to do
Recognise [dependencies.<crate>], [dev-dependencies.<crate>], [build-dependencies.<crate>], and the [target.<spec>.<kind>.<crate>] variants, reading version, optional, path, git and workspace keys the same way the inline-table form does.
Confirmed: cargoDependencyHeader in rust-scanner.ts returns null for [dependencies.<crate>], and parseCargoToml then ignores every line until the next real dependency table. One way in is to let the header parser return the table kind plus an optional crate name, then in parseCargoToml collect the key = value lines of that sub-table into the same object shape the inline-table branch builds, and push it when the next header starts (and at end of file). That way version, optional, path, git and workspace = true reuse the existing handling, and dedupeCargoDeps applies the current precedence for free. Remember to flush the pending crate before switching tables, otherwise the last sub-table in a file is easy to lose.
Activity
vibgrate-team commentedon Nov 2, 2026
Confirmed:
cargoDependencyHeaderinrust-scanner.tsreturnsnullfor[dependencies.<crate>], andparseCargoTomlthen ignores every line until the next real dependency table. One way in is to let the header parser return the table kind plus an optionalcratename, then inparseCargoTomlcollect thekey = valuelines of that sub-table into the same object shape the inline-table branch builds, and push it when the next header starts (and at end of file). That wayversion,optional,path,gitandworkspace = truereuse the existing handling, anddedupeCargoDepsapplies the current precedence for free. Remember to flush the pending crate before switching tables, otherwise the last sub-table in a file is easy to lose.