Cargo crate vulnerability checker
Check any version of a Rust crate from crates.io for known vulnerabilities. See each RUSTSEC advisory or CVE and the crate version that fixes it.
The crate’s name as in Cargo.lock: time, openssl.
One exact version, as in your lockfile. Not a range.
This tool asks the OSV API directly from your browser. It sends the crate name and the version you check, and nothing is sent to HardenKit.
How to use the cargo crate vulnerability checker
- Enter the crate’s name as it appears in Cargo.lock.
- Enter the exact version from Cargo.lock or cargo tree.
- Press the button to ask OSV.
- Read the table, worst first, then cargo update the crate to the “Fixed in” version or later.
About this tool
Rust removes whole classes of memory bugs, but crates still get advisories: unsound unsafe code, denial of service in parsers, flaws in cryptography, and now and then a malicious upload. Enter a crate name and an exact version to see the known vulnerabilities that cover it and the release that fixes each one. Nothing is downloaded or compiled.
Take the name and version from Cargo.lock, or from cargo tree, which also shows why a crate is in the build. Cargo.toml is not enough: a requirement such as time = "0.1" allows every compatible release, and the lockfile records which one was chosen. A build can hold two versions of the same crate at once, so check each one that cargo tree lists.
The data comes from OSV, which carries the RustSec Advisory Database (the RUSTSEC IDs) and the GitHub Advisory Database. cargo audit, the RustSec tool, checks an entire Cargo.lock against the same advisories and also warns about unmaintained and yanked crates. This page reports vulnerabilities for one crate version, and merges the RustSec and GitHub records of the same issue into one row.
Sources
Questions
cargo audit reads Cargo.lock and checks every crate in the build against the RustSec Advisory Database. This checker looks up one crate version and needs no Rust toolchain. Run cargo audit in CI; use this page to answer a single question quickly.
It is the ID the RustSec Advisory Database gives an advisory, such as RUSTSEC-2020-0071. Many also have a CVE ID and a GitHub advisory ID. We show one row per vulnerability with the other IDs beside it.
Two of your dependencies can require incompatible versions of one crate, and Cargo then builds both. Each version is in your binary, so each needs checking. cargo tree -d lists the duplicates.
No. This page lists vulnerabilities only. RustSec also publishes notices for unmaintained and unsound crates, which cargo audit reports as warnings.