Repository navigation
feat: scan the Rust crates of Cargo.lock - #3
Merged
Merged
Conversation
The dependency scan only read uv.lock, so the crates that a Rust extension compiles into a wheel were never checked. It now reads every tracked Cargo.lock too, from the same script. The crates go to OSV, like the Python packages, rather than to cargo-audit: OSV imports the RustSec database and GitHub's advisories for crates.io, so the severity (GitHub's), the exceptions, the job summary and the annotations are shared, and the job needs no Rust toolchain. Only crates from crates.io are queried, so the names of crates from git, a path or another registry never leave the runner. Cargo.lock doesn't record dependency kinds, so every crate counts as a runtime dependency. RustSec's informational advisories (unmaintained, unsound, notice) have no GHSA record: they are reported with their kind as the severity and don't block. A RustSec vulnerability without a GHSA record still has an unknown severity and blocks. Crate names are compared exactly, as cargo does. The summary and the annotations name the lock they come from, a repository with only one kind of lock scans that kind, and one with neither still passes with a notice. Assisted-by: Pi:claude-sonnet-5-5
robertodr
force-pushed
the
feat/cargo-lock
branch
from
November 21, 2026 19:02
f0a1db9 to
b25f587
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
The dependency scan only read
uv.lock, so the crates that a Rust extension compiles into a wheel were never checked. It now reads every trackedCargo.locktoo, with the same rules as for Python.Changes
uv.lockandCargo.lockfiles (in the root and in subdirectories). A repository with only one kind scans that kind, and one with neither passes with the notice, whose text now names both.crates.io) from the same script, not to cargo-audit: OSV imports the RustSec database and GitHub's advisories for crates.io, so the severity (GitHub's, from the GHSA record), the exceptions, the job summary and the annotations are shared, and the job needs no Rust toolchain and no extra binary.registry+https://github.com/rust-lang/crates.io-index, or the sparse index form as thesource). The packages of the workspace and the crates from git, a path or another registry are left out, so their names never leave the runner. Lock versions 3 and 4 have the same[[package]]tables and both are read.Cargo.lockhas no dependency kinds or features, so the dev-dependencies and build-dependencies can't be told apart without cargo. The README and the summary say so ("Needed at":run time).unmaintained,unsound,notice) have no GHSA record. They are reported with the kind as the severity (informational: unmaintained) and never block. If GitHub has an advisory for the same issue, GitHub's severity applies. A RustSec vulnerability that GitHub doesn't know still has an unknown severity and blocks, as for Python: RustSec's CVSS is not used.foo-barandfoo_barapart), and the fix versions only come from theaffectedentries of the right ecosystem. Python names are still compared as PEP 503 does.rust/Cargo.lock). Yanked crates are not reported: OSV doesn't list them (documented).RUSTSEC-ids, development) cover both lock kinds. The step'srun, permissions and checkouts are unchanged.Validation
OFFLINE=1, which skips the 7 end-to-end ones): unit tests with a fake OSV for the crates.io filter, lock versions 3 and 4, informational notices, an unknown-severity RustSec vulnerability, a repository withuv.lockandrust/Cargo.lock, aCargo.lockonly, and exceptions byRUSTSEC-and by GHSA id; end-to-end tests with a hand-writtenCargo.lock(instant 0.1.12,rsa 0.9.6,pyo3 0.19.0), no cargo needed.checkandformat --check), actionlint and zizmor report nothing.instant, informational), RUSTSEC-2023-0071 (rsa, with GHSA aliases, one finding with the GHSA severity) and RUSTSEC-2025-0020 (pyo3); GHSA records for crates.io havedatabase_specific.severity.Cargo.lock(110 crates, generated by cargo 1.99, lock version 4): 7 informational notices, nothing blocking, exit 0. ACargo.lockwithpyo3 0.19.0blocks with an error annotation onrust/Cargo.lock.