X0003 audit-vulnerabilities¶
Rule: No dependency has a published security vulnerability.
| Code | X0003 (stable, never reused) |
| Id | audit-vulnerabilities |
| Category | audit |
| Source | cargo-audit (run as an executable) |
| Fix | by hand |
| Needs | cargo-audit installed |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | off | |
| big | off | |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Parameters¶
| Name | Type | Default | Meaning |
|---|---|---|---|
fetch |
boolean | true |
update the advisory database first; false checks against the local copy (--no-fetch); every audit lint reads it |
Why¶
A dependency with a published vulnerability puts every user of the project at risk. cargo-audit checks Cargo.lock against the RustSec advisory database.
How to fix¶
Update the crate to a patched version (cargo update -p NAME); the finding names the patched versions. An advisory that does not apply is ignored in .cargo/audit.toml with a comment saying why:
Configure¶
[lints.audit-vulnerabilities]
level = "deny"
fetch = true
reason = "why this project wants it at this level"
Allow one finding in the code with // spirit-level: allow(audit-vulnerabilities) <reason> (waivers); the code works there too, as in [lints.X0003].