Cargo Vet is a tool for verifying that third-party Rust dependencies have been audited by trusted entities. This document describes our internal development process for auditing dependencies using cargo-vet.
serdes instead of serde), relying on a developer mistyping a dependency name.Supply chain attacks target the software development process through typosquatting, compromised updates, and account takeovers. Each dependency increases attack surface, audit burden, and potential for forced patch releases. Our audit process defends against these threats through multiple layers:
Cargo.lock, preventing automatic updates. Any version change requires an explicit commit and must pass cargo-vet checks.Install cargo-vet with cargo install cargo-vet. For commands and detailed usage, run cargo vet --help or see the official documentation.
New repositories should be initialized with cargo vet init. After initialization:
cargo vet to fetch imported auditscargo vet check after any Cargo.lock changesWhen patching a vulnerability, consider whether a patch release of our own crates is needed. Even if our code is not directly impacted, downstream dependencies of our crates may be affected.
For dependencies from well-established maintainers or widely-used crates, you may add an exemption for a specific version instead of performing a full audit. Subsequent version updates must still be audited as diffs from the exempted version. Exemptions should be temporary and can be reduced over time by auditing or adding trust entries.
You can also trust publishers directly using cargo vet trust. This is appropriate for:
aranya-* and spideroak-* crates published by aranya-project-bot because they go through our internal review process and are published via a secured CI/CD pipelineFor crates in your workspace that aren’t published to crates.io, manually set audit-as-crates-io = false in the crate’s Cargo.toml [package] section to skip auditing.
For initial audits, evaluate the overall quality of the crate: does it have tests, documentation, and specs? Is unsafe code minimal and well-documented? Is the project actively maintained? These signals help assess whether the crate is trustworthy.
The primary goal of diff audits is to catch malicious changes introduced in updates. Watch for red flags like obfuscated code, hardcoded network addresses, checked-in binaries, or build scripts that download code.
Cargo-vet defines two built-in criteria: safe-to-run (no surprising filesystem, network, or system resource usage) and safe-to-deploy (no serious security vulnerabilities, with full reasoning about unsafe blocks and powerful imports). safe-to-deploy implies safe-to-run—it is the strictly stronger criterion. All audits should use the safe-to-deploy criteria because Aranya crates are deployed to production environments exposed to untrusted input. If an audit can only certify a dependency as safe-to-run, the team should discuss whether that dependency can be included in Aranya before proceeding. Document your findings in audit notes, including whether areas of concern are actually used by our code. See the cargo-vet documentation on recording audits for details on the audit file format.
Example audit note:
Parser/encoder library. Contains documented unsafe code for buffer
manipulation during encoding. No networking code. Reader/writer
interface allows caller to manage file I/O.
This example shows the typical commands used when auditing dependencies:
# Check what needs auditing
cargo vet check
# Review a new crate (opens source for inspection)
cargo vet inspect some-crate 1.0.0
# Review changes between versions (opens diff in browser)
cargo vet diff some-crate 1.0.0 1.1.0
# After review, certify the crate
cargo vet certify some-crate 1.0.0 # Full audit
cargo vet certify some-crate 1.0.0 1.1.0 # Relative audit
# Or add an exemption for trusted crates
cargo vet add-exemption some-crate 1.0.0
# Trust a publisher for all their crates
cargo vet trust some-crate some-publisher
# Clean up after removing dependencies
cargo vet prune
# Format supply-chain files
cargo vet fmt
# Verify CI check will pass before pushing
cargo make cargo-vet
cargo vet inspect or cargo vet diff. Reviewing every line is not required, especially for large changes—use your judgement to focus on code that is likely to be problematic.cargo make cargo-vet locally to verify CI will passsupply-chain/ changes with your PRReviewers should consider re-auditing when the dependency handles security-sensitive operations, the notes seem incomplete, the author is new to the process, or anything was flagged during review of the dependency or audit notes.
If you discover a crate version that fails criteria, communicate with the team so it can be evaluated before recording a violation with cargo vet record-violation.
PRs with unaudited dependencies will fail CI checks and cannot be merged into protected branches.