Check Cargo.lock for vulnerable dependencies
Upload or paste your Cargo.lock. We check every Rust package version in it
against OSV.dev and email you the
vulnerable ones, the version that fixes them and the Cargo command to upgrade. Free, and no account needed.
About Cargo.lock
Cargo.lock is written by Cargo next to Cargo.toml (at the workspace root in a workspace). It records the exact version of every crate in the build.
To write or refresh it:
cargo generate-lockfile
cargo build also writes it. Commit it: Cargo's guidance recommends this for libraries too.
Good to know
- Cargo.toml cannot be checked: "1.2" means "1.2.0 or any later 1.x".
- In a workspace, check the one Cargo.lock at the root.
Fixing a vulnerable package
The report gives the fixed version for each vulnerable package (FIXED below). With Cargo:
# Upgrade one crate within its parents' ranges
cargo update -p crate
# Or to an exact version
cargo update -p crate --precise FIXED
cargo update -p works for indirect crates too; if a parent crate requires an older major version, upgrade the parent.
Then run your tests and commit the updated Cargo.lock.
cargo audit and this check
cargo audit uses the RustSec advisory database, which OSV.dev includes. This check needs nothing installed and works for your other languages too.
Other lockfiles
Related free tools
GitHub repo vulnerability check
Paste a public GitHub repo URL. We find every lockfile, check each package version against OSV.dev and email you the fixes. Free, no account.
Dependency vulnerability check
Check requirements.txt, package-lock.json, poetry.lock and more against OSV.dev. Free report by email with fix commands. No account needed.
Last updated .