Skip to content

Commit af1c01a

Browse files
la10736claude
andauthored
Fix cargo audit: update 4 crates, add 21 new ignore entries (#54)
Updated dependencies: - bytes 1.10.1 → 1.11.1 (RUSTSEC-2026-0007) - rustls-webpki 0.103.4 → 0.103.13 (4 advisories) - quinn-proto 0.11.13 → 0.11.14 (RUSTSEC-2026-0037) - time 0.3.43 → 0.3.47 (RUSTSEC-2026-0009) Rebuilt ignore list from scratch: - Removed stale RUSTSEC-2024-0336 (no longer fires) - Added 21 new entries for wasmtime, hickory-proto, rustls-webpki, keccak, and rand advisories with motivated comments - Refreshed existing entries with updated comments Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7f43951 commit af1c01a

4 files changed

Lines changed: 443 additions & 63 deletions

File tree

.cargo/audit.toml

Lines changed: 166 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,171 @@
11
[advisories]
22
ignore = [
3-
# Coming from outdated libp2p and litep2p dependencies from which
4-
# some Polkadot libraries are dependent on. They will be updated
5-
# once we update Polkadot packages to latest version
6-
"RUSTSEC-2024-0336",
7-
"RUSTSEC-2024-0421",
8-
"RUSTSEC-2025-0009",
9-
"RUSTSEC-2024-0363", # Maybe we should fix the sqlx dependency in our frontier branch
10-
# The next two coming from outdated wasmtime dependency from wich polkadot
11-
# and substrate crates are dependent on. Unfortunally seams that also the
12-
# newver versions still depend from the same wasmtime version.
13-
"RUSTSEC-2023-0091", # LOW severity
14-
"RUSTSEC-2024-0438", # Just affect Windows where devices are not fully sandboxed.
15-
"RUSTSEC-2024-0442", # FROM THE VUNERABILITY DESCRIPTION
16-
# Note: this is an internal-only crate in the Wasmtime project not intended for external
17-
# use and is more strongly signaled nowadays as of bytecodealliance/wasmtime#10963.
18-
# Please open an issue in Wasmtime if you're using this crate directly.
19-
# ** We don't use this crate directly, so we can ignore it. **
20-
"RUSTSEC-2025-0055", # coming from indirect dependency tracing-subscriber
21-
"RUSTSEC-2025-0118", # coming from indirect dependency wasmtime v0.8.1.
22-
# From https://rustsec.org/advisories/RUSTSEC-2025-0118 ->
23-
# https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hc7m-r6v8-hg9q
24-
# "This is a bug in Wasmtime's safe Rust API. It should not be possible to cause unsoundness
25-
# with Wasmtime's embedding API if unsafe is not used. Embeddings which do not use the wasm
26-
# threads proposal nor created shared memories nor actually share shared memories across
27-
# threads are unaffected. Only if shared memories are created across threads might an
28-
# embedding be affected."
29-
# We fall in the case where we don't use wasm threads at all.
30-
"RUSTSEC-2026-0002", # coming from indirect dependency in smoldot-light@v0.9.0 and libp2p-identify@0.43.1.
31-
# For smoldot-light@v0.9.0, we looked into the code at https://github.com/smol-dot/smoldot.git@light-js-deno-v1.0.17;
32-
# all the usage of `lru::LruCache` don't use `iter_mut()` or iterate over `&mut` cache reference.
33-
# For the libp2p-identify@0.43.1, we looked into the code at https://github.com/libp2p/rust-libp2p.git@libp2p-identify-v0.43.1
34-
# and in protocols/identify/src/behaviour.rs we can see that there isn't any mutable iterator used for
35-
# `lru::LruCache`.
36-
# We can conclude that the unsound code is never exercised.
3+
# ===== libp2p / litep2p transitive dependencies =====
4+
5+
"RUSTSEC-2024-0421", # idna v0.4.0 — from libp2p v0.52.4 and litep2p v0.9.5.
6+
# Punycode label acceptance issue. No compatible update; pinned by polkadot-sdk.
7+
8+
"RUSTSEC-2025-0009", # ring v0.16.20 — stale lockfile entry (libp2p-quic -> libp2p-tls -> rcgen -> ring 0.16).
9+
# Nothing in the workspace actually depends on this chain (`cargo tree` confirms it).
10+
# It remains in Cargo.lock because Cargo always resolves optional dependencies.
11+
12+
"RUSTSEC-2026-0037", # quinn-proto v0.10.6 — stale lockfile entry from libp2p-quic v0.10.3 optional feature.
13+
# `cargo tree` shows nothing; only present in Cargo.lock via optional dependency resolution.
14+
15+
"RUSTSEC-2026-0118", # hickory-proto v0.25.2 — NSEC3 closest-encloser proof unbounded loop.
16+
# From https://github.com/hickory-dns/hickory-dns/security/advisories/GHSA-3v94-mw7p-v465
17+
# Transitive via litep2p v0.9.5 -> hickory-resolver v0.25.2. No fix available;
18+
# even the latest litep2p still depends on hickory-proto 0.25.2.
19+
20+
"RUSTSEC-2026-0119", # hickory-proto v0.24.4 & v0.25.2 — O(n²) CPU exhaustion in name compression.
21+
# From https://github.com/hickory-dns/hickory-dns/security/advisories/GHSA-q2qq-hmj6-3wpp
22+
# v0.24.4 from libp2p v0.54.1 -> libp2p-dns v0.42.0; v0.25.2 from litep2p v0.9.5.
23+
# Fix requires hickory-proto >= 0.26.1; no compatible update in libp2p/litep2p yet.
24+
25+
# ===== rustls-webpki (pinned by major version boundaries) =====
26+
# rustls-webpki 0.101.7 (via rustls 0.21.12 -> libp2p-websocket/hyper-rustls/jsonrpsee)
27+
# and 0.102.8 (via rustls 0.22.4 -> jsonrpsee-client-transport) cannot be updated to
28+
# the fixed 0.103.12+ without upgrading rustls across a major version boundary.
29+
# The primary path (rustls 0.23.x -> webpki 0.103.13) is already fixed.
30+
31+
"RUSTSEC-2026-0049", # rustls-webpki v0.102.8 — CRL Distribution Point faulty matching logic.
32+
# From https://rustsec.org/advisories/RUSTSEC-2026-0049
33+
# Fix requires >= 0.103.10 which needs rustls >= 0.23.x. Pinned by jsonrpsee 0.22.5.
34+
35+
"RUSTSEC-2026-0098", # rustls-webpki v0.101.7 & v0.102.8 — URI name constraints incorrectly accepted.
36+
# From https://rustsec.org/advisories/RUSTSEC-2026-0098
37+
# Requires certificate misissuance with URI name constraints; low risk for P2P TLS.
38+
39+
"RUSTSEC-2026-0099", # rustls-webpki v0.101.7 & v0.102.8 — wildcard name constraint bypass.
40+
# From https://rustsec.org/advisories/RUSTSEC-2026-0099
41+
# Requires certificate misissuance; low risk for P2P TLS.
42+
43+
"RUSTSEC-2026-0104", # rustls-webpki v0.101.7 & v0.102.8 — reachable panic in CRL parsing.
44+
# From https://rustsec.org/advisories/RUSTSEC-2026-0104
45+
# Panic reachable before signature verification via malformed CRL. DoS risk in adversarial P2P,
46+
# but update is blocked by major version boundary. Primary path (0.103.13) is already fixed.
47+
48+
# ===== sqlx (frontier dependency) =====
49+
50+
"RUSTSEC-2024-0363", # sqlx v0.7.4 — binary protocol misinterpretation via truncating casts.
51+
# From frontier's fc-db. Should be fixed when updating the frontier fork.
52+
53+
# ===== tracing-subscriber (arkworks dependency) =====
54+
55+
"RUSTSEC-2025-0055", # tracing-subscriber v0.2.25 — ANSI escape sequence log poisoning.
56+
# Via ark-relations v0.4.0 which unconditionally enables tracing-subscriber 0.2.x.
57+
# This is an upstream arkworks issue; no patched version of ark-relations avoids it.
58+
59+
# ===== wasmtime v8.0.1 (polkadot-sdk via sc-executor-wasmtime v0.36.0) =====
60+
# All wasmtime advisories below are from the outdated wasmtime v8.0.1 dependency
61+
# pulled in by polkadot-sdk. Updating requires an upstream polkadot-sdk release.
62+
63+
# -- Already existing ignores (refreshed) --
64+
65+
"RUSTSEC-2023-0091", # wasmtime v8.0.1 — i64x2.shr_s miscompilation with constant input.
66+
# LOW severity. Constant input requirement limits practical exploitation.
67+
68+
"RUSTSEC-2024-0438", # wasmtime v8.0.1 — Windows device filenames not fully sandboxed.
69+
# Only affects Windows; our deployment targets Linux.
70+
71+
"RUSTSEC-2024-0442", # wasmtime-jit-debug v8.0.1 — JitDumpFile undefined memory dump.
72+
# From https://rustsec.org/advisories/RUSTSEC-2024-0442
73+
# Internal-only wasmtime crate not intended for external use. We don't use it directly.
74+
75+
"RUSTSEC-2025-0118", # wasmtime v8.0.1 — unsound API access to shared linear memory.
76+
# From https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hc7m-r6v8-hg9q
77+
# Only affects embeddings using the wasm threads proposal with shared memories across threads.
78+
# Substrate explicitly sets config.wasm_threads(false) in sc-executor-wasmtime.
79+
80+
# -- Wasmtime: Component Model not used by Substrate --
81+
# wasmtime 8.0.1 predates stable Component Model support.
82+
# Substrate does not enable the Component Model.
83+
84+
"RUSTSEC-2026-0085", # wasmtime v8.0.1 — panic lifting flags component value.
85+
# From https://rustsec.org/advisories/RUSTSEC-2026-0085
86+
# Requires Component Model which Substrate does not use.
87+
88+
"RUSTSEC-2026-0091", # wasmtime v8.0.1 — OOB write transcoding component model strings.
89+
# From https://rustsec.org/advisories/RUSTSEC-2026-0091
90+
# Requires Component Model which Substrate does not use.
91+
92+
"RUSTSEC-2026-0092", # wasmtime v8.0.1 — panic with misaligned component model UTF-16 strings.
93+
# From https://rustsec.org/advisories/RUSTSEC-2026-0092
94+
# Requires Component Model which Substrate does not use.
95+
96+
"RUSTSEC-2026-0093", # wasmtime v8.0.1 — heap OOB read in component model UTF-16 transcoding.
97+
# From https://rustsec.org/advisories/RUSTSEC-2026-0093
98+
# Requires Component Model which Substrate does not use.
99+
100+
# -- Wasmtime: WASI not used by Substrate --
101+
# sc-executor-wasmtime does not load WASI modules.
102+
103+
"RUSTSEC-2026-0020", # wasmtime v8.0.1 — guest-controlled resource exhaustion in WASI.
104+
# From https://rustsec.org/advisories/RUSTSEC-2026-0020
105+
# Requires WASI which Substrate does not use.
106+
107+
"RUSTSEC-2026-0021", # wasmtime v8.0.1 — panic in wasi:http/types.fields.
108+
# From https://rustsec.org/advisories/RUSTSEC-2026-0021
109+
# Requires WASI HTTP which Substrate does not use.
110+
111+
# -- Wasmtime: Winch compiler not used (Substrate uses Cranelift) --
112+
113+
"RUSTSEC-2026-0086", # wasmtime v8.0.1 — host data leakage with 64-bit tables and Winch.
114+
# From https://rustsec.org/advisories/RUSTSEC-2026-0086
115+
# Requires Winch compiler; Substrate uses Cranelift.
116+
117+
"RUSTSEC-2026-0089", # wasmtime v8.0.1 — host panic when Winch executes table.fill.
118+
# From https://rustsec.org/advisories/RUSTSEC-2026-0089
119+
# Requires Winch compiler; Substrate uses Cranelift.
120+
121+
"RUSTSEC-2026-0094", # wasmtime v8.0.1 — improperly masked table.grow return value with Winch.
122+
# From https://rustsec.org/advisories/RUSTSEC-2026-0094
123+
# Requires Winch compiler; Substrate uses Cranelift.
124+
125+
"RUSTSEC-2026-0095", # wasmtime v8.0.1 — Winch sandbox-escaping memory access.
126+
# From https://rustsec.org/advisories/RUSTSEC-2026-0095
127+
# Requires Winch compiler; Substrate uses Cranelift.
128+
129+
# -- Wasmtime: Requires non-default configuration --
130+
131+
"RUSTSEC-2026-0087", # wasmtime v8.0.1 — f64x2.splat segfault/OOB load on Cranelift x86-64.
132+
# From https://rustsec.org/advisories/RUSTSEC-2026-0087
133+
# Only triggers when signals_based_traps is DISABLED (non-default).
134+
# Substrate uses wasmtime::Config::new() which has signals_based_traps enabled by default
135+
# and never disables it. Therefore this code path is never exercised.
136+
137+
"RUSTSEC-2026-0088", # wasmtime v8.0.1 — data leakage between pooling allocator instances.
138+
# From https://rustsec.org/advisories/RUSTSEC-2026-0088
139+
# Requires pooling allocator with specific non-default config.
140+
# Substrate uses on-demand (not pooling) instance allocation.
141+
142+
"RUSTSEC-2026-0096", # wasmtime v8.0.1 — miscompiled guest heap access on aarch64 Cranelift.
143+
# From https://rustsec.org/advisories/RUSTSEC-2026-0096
144+
# CRITICAL severity but only affects aarch64 architecture.
145+
# Our primary deployment targets x86-64. Pinned by polkadot-sdk; no update path available.
146+
147+
# ===== lru (unsound — IterMut not exercised) =====
148+
149+
"RUSTSEC-2026-0002", # lru v0.12.5 — unsound IterMut via Stacked Borrows violation.
150+
# Used by libp2p-identify v0.43.1 and smoldot-light v0.9.0 (polkadot-sdk transitive).
151+
# We checked the source code: no mutable iterator (IterMut) is used on lru::LruCache
152+
# in either crate. The unsound code path is never exercised.
153+
154+
# ===== keccak (unsound — asm feature not enabled) =====
155+
156+
"RUSTSEC-2026-0012", # keccak v0.1.5 — unsound ARMv8 assembly backend.
157+
# From https://rustsec.org/advisories/RUSTSEC-2026-0012
158+
# The ARMv8 assembly backend is opt-in via the `asm` feature flag.
159+
# This feature is not enabled in any dependency in the workspace.
160+
# The default pure-Rust implementation is not affected.
161+
162+
# ===== rand (unsound — custom logger not used) =====
163+
164+
"RUSTSEC-2026-0097", # rand v0.8.5 & v0.9.2 — unsound with custom logger using rand::rng().
165+
# From https://rustsec.org/advisories/RUSTSEC-2026-0097
166+
# Only triggers when a custom logger implementation calls rand::rng() during ThreadRng
167+
# reseeding. This project uses Substrate's standard sc-tracing logging infrastructure
168+
# which does not call rand::rng(). The trigger conditions are not met.
37169
]
38170
informational_warnings = ["unmaintained", "yanked"]
39171

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
name: Cargo Audit Triage
3+
description: >
4+
This skill should be used when the user asks to "run cargo audit",
5+
"triage cargo audit", "fix audit vulnerabilities", "update audit.toml",
6+
"check cargo audit ignores", "clean up audit ignore list",
7+
"review audit.toml", "remove stale audit ignores", or mentions
8+
resolving Rust security advisories or RUSTSEC identifiers. Provides a
9+
systematic workflow for
10+
analyzing each vulnerability, attempting updates, and writing motivated
11+
ignore entries when updates are not possible.
12+
---
13+
14+
# Cargo Audit Triage
15+
16+
Systematic workflow for running `cargo audit`, analyzing each reported
17+
vulnerability, attempting dependency updates, and documenting justified
18+
ignores in `.cargo/audit.toml`.
19+
20+
## Workflow Overview
21+
22+
1. Read the existing `.cargo/audit.toml` ignore list for context
23+
2. Run `cargo audit`
24+
3. For each vulnerability, follow the resolution decision tree
25+
4. For existing ignore entries, verify they still fire
26+
27+
## Step 1: Read Existing Ignore List
28+
29+
Read `.cargo/audit.toml` before running the audit. Study the existing
30+
ignore entries and their motivations to understand the project's
31+
conventions and writing style for ignore comments.
32+
33+
## Step 2: Run Cargo Audit
34+
35+
```bash
36+
cargo audit
37+
```
38+
39+
Collect all reported vulnerabilities (errors) and warnings. Separate them
40+
into:
41+
- **Vulnerabilities** (errors) — must be resolved or ignored with motivation
42+
- **Warnings** (unmaintained, yanked) — informational, no action required
43+
44+
## Step 3: Resolve Each Vulnerability
45+
46+
For each vulnerability, follow this decision tree in order.
47+
48+
### 3a. Identify the Dependency Chain
49+
50+
```bash
51+
cargo tree -i <crate>@<version> --depth 3
52+
```
53+
54+
Determine whether the vulnerable crate is:
55+
- A **direct dependency** (listed in a workspace or crate `Cargo.toml`)
56+
- A **transitive dependency** (pulled in by another crate)
57+
58+
If `cargo tree` reports "nothing to print", try `--target all --edges all`.
59+
If still nothing, the entry may be a **stale lockfile artifact** — verify
60+
by searching `Cargo.lock` directly:
61+
62+
```bash
63+
grep -B30 '"<crate> <version>"' Cargo.lock | grep 'name ='
64+
```
65+
66+
### 3b. Attempt to Update
67+
68+
**Direct dependency with a patched version available:**
69+
Update the version in `Cargo.toml` to the fixed version and run
70+
`cargo check` to verify compatibility.
71+
72+
**Transitive dependency with a compatible patched version:**
73+
Run `cargo update -p <crate>@<version>` to attempt an in-place update.
74+
Verify with `cargo audit` afterward.
75+
76+
**Transitive dependency where the patched version is incompatible:**
77+
Check if the **parent crate** has a newer version that uses the patched
78+
dependency:
79+
80+
```bash
81+
cargo search <parent-crate>
82+
cargo info <parent-crate>@<latest-version>
83+
```
84+
85+
If a compatible parent update exists, update it. If the parent is pinned
86+
by an upstream framework (e.g., polkadot-sdk), updating may not be feasible.
87+
88+
### 3c. Analyze the Advisory (When Update Is Not Possible)
89+
90+
When no update path exists, perform a thorough analysis before ignoring:
91+
92+
1. **Read the advisory page** at the URL from the audit output
93+
2. **Read the upstream security advisory** (usually linked from the
94+
rustsec page, often a GitHub Security Advisory / GHSA)
95+
3. **Identify the trigger conditions** — what configuration, API usage,
96+
or code path activates the vulnerability
97+
4. **Check the project's actual usage** — read the relevant source code
98+
to verify whether the trigger conditions are met
99+
100+
Common safe-to-ignore patterns:
101+
- Vulnerability requires a feature/config that is not enabled
102+
(e.g., `wasm_threads(false)` means thread-related vulns don't apply)
103+
- Vulnerability affects a platform not targeted
104+
(e.g., Windows-only issue on a Linux-only deployment)
105+
- Vulnerable code path is never exercised
106+
(e.g., `IterMut` on a cache that is only read)
107+
- Crate is a stale lockfile entry not actually used by the workspace
108+
109+
### 3d. Add Ignore Entry
110+
111+
Add the advisory to `.cargo/audit.toml` with a **motivated comment**
112+
explaining:
113+
- Where the dependency comes from (the dependency chain)
114+
- A link to the advisory and/or upstream security advisory
115+
- **Why it is safe to ignore** — the specific condition that makes the
116+
project unaffected
117+
118+
Follow the comment style already present in the file. See
119+
`references/ignore-examples.md` for examples.
120+
121+
## Step 4: Verify Existing Ignore Entries
122+
123+
To clean up the ignore list:
124+
125+
1. Remove **all** entries from the `ignore` list
126+
2. Run `cargo audit` with the empty list
127+
3. Note which advisories still fire
128+
4. Re-add only the entries that still fire, with refreshed comments
129+
5. Remove entries that no longer fire (dependency was updated or removed)
130+
131+
## Ignore Comment Format
132+
133+
Each ignore entry should follow this pattern:
134+
135+
```toml
136+
"RUSTSEC-YYYY-NNNN", # <crate> v<version> — short summary of the chain.
137+
# Link to advisory and/or upstream security advisory.
138+
# Explanation of why it is safe to ignore in this project's context.
139+
```
140+
141+
Keep comments concise but complete. The goal is that a future reader can
142+
understand the decision without re-investigating.
143+
144+
## Additional Resources
145+
146+
### Reference Files
147+
148+
- **`references/ignore-examples.md`** — Real-world examples of well-motivated
149+
ignore entries from a production Cargo workspace

0 commit comments

Comments
 (0)