Audit Cargo.lock for crates with known security vulnerabilities
open sourceApache-2.0 OR MITself-hostablefree
cargo-audit is a Cargo subcommand that checks a Rust project's Cargo.lock against the RustSec Advisory Database, the Rust ecosystem's database of vulnerabilities in crates, and reports each affected crate with its advisory, the fixed versions and where it sits in the dependency tree. cargo audit bin audits compiled binaries (fully when built with cargo-auditable), an experimental cargo audit fix updates vulnerable requirements in Cargo.toml, advisories can be ignored or filtered by target platform in audit.toml, and it runs in CI, including through the rust-audit-check GitHub Action. RustSec also maintains the rustsec crate and exports its advisories to OSV. Apache-2.0 or MIT.
Ways to install
Package managers
Problems it solves
- check my Rust dependencies for known security vulnerabilities
- fail CI when a crate in Cargo.lock has a security advisory
- audit a compiled Rust binary for vulnerable crates
Features
- audit Cargo.lock against the RustSec Advisory Database
- audit compiled binaries
- experimental automatic fix
- ignore and platform filters in audit.toml
- GitHub Action
Limitations
- If Cargo.lock is missing it runs cargo update, which can execute code from the project: audit untrusted projects with --file from outside them2
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what cargo-audit does.
- OSV-Scanner Find known vulnerabilities in your project's dependencies, using OSV.dev
- Snyk Find, fix and prevent vulnerabilities in code, open source dependencies, container images and cloud configurations
- Dependabot Automated dependency updates built into GitHub
- govulncheck Find known vulnerabilities that actually affect your Go code
- pip-audit Audit Python environments and dependency files for known vulnerabilities
- Socket Software supply chain security that catches malicious and risky dependencies
