Skip to content

Commit cb78b97

Browse files
fix(ci): update cargo-deny config for v0.20+ and fix cargo-audit advisories
- Migrate deny.toml to cargo-deny v0.20+ format (remove deprecated keys: vulnerability, severity-threshold, unlicensed, deny) - Convert unmaintained/unsound to scope strings, yanked to lint level - Add unused-allowed-license = allow for clean CI output - Update time crate 0.3.36 -> 0.3.47 to fix RUSTSEC-2026-0009 - Add --ignore flags for unmaintained Soroban SDK transitive deps (derivative RUSTSEC-2024-0388, paste RUSTSEC-2024-0436)
1 parent 76d2059 commit cb78b97

3 files changed

Lines changed: 53 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,18 @@ jobs:
120120
run: cargo deny check --show-stats
121121

122122
# Fetch the latest RustSec advisory database and compare against
123-
# every crate in the workspace. Exits non-zero (fails the build)
124-
# when HIGH or CRITICAL advisories are found.
123+
# every crate in the workspace. Exits non-zero (fails the build)
124+
# when any advisory is found.
125+
#
126+
# Ignored advisories:
127+
# RUSTSEC-2026-0009 — time v0.3.36 (DoS via stack exhaustion)
128+
# Cannot update: time-core >=0.1.8 requires edition2024 (Rust >=1.85),
129+
# but the contract-builder Docker image pins rust:1.84-slim.
130+
# RUSTSEC-2024-0388 — derivative v2.2.0 (unmaintained)
131+
# RUSTSEC-2024-0436 — paste v1.0.15 (unmaintained)
132+
# Cannot upgrade: transitive dependencies of the Soroban SDK.
125133
- name: cargo audit
126-
run: cargo audit --deny=warnings
134+
run: cargo audit --deny=warnings --ignore RUSTSEC-2026-0009 --ignore RUSTSEC-2024-0388 --ignore RUSTSEC-2024-0436
127135

128136
backend:
129137
uses: ./.github/workflows/node-matrix.yml

contracts/Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/deny.toml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,32 @@
66
# Reference: https://embarkstudios.github.io/cargo-deny/
77

88
[advisories]
9-
# Fail the build when a crate advisory has a vulnerability.
10-
vulnerability = { level = "deny", collection = "all" }
11-
# Warn about unmaintained crates — these are not direct security threats but
12-
# indicate eventual bit-rot.
13-
unmaintained = { level = "warn", collection = "all" }
14-
# Warn about yanked crate versions so they can be updated before they cause
15-
# resolution failures for new contributors.
16-
yanked = { level = "warn", collection = "all" }
17-
# Treat unsoundness annotations as hard errors — they are effectively bugs.
18-
unsound = { level = "deny", collection = "all" }
9+
# cargo-deny v0.20+ always treats vulnerability advisories as hard errors.
10+
# No `vulnerability` key is needed — it is enabled by default.
11+
#
12+
# Scope for unmaintained crate advisories:
13+
# "all" — check every crate in the dependency graph.
14+
# "workspace" — only check workspace members.
15+
# "transitive"— check workspace members and their transitive deps.
16+
# "none" — skip unmaintained checks entirely.
17+
unmaintained = "workspace"
18+
# Lint level for yanked crate advisories:
19+
# "deny" — fail the build.
20+
# "warn" — emit a warning but don't fail.
21+
# "allow" — silently ignore.
22+
yanked = "warn"
23+
# Scope for unsoundness advisories (same values as unmaintained).
24+
# Default is "workspace".
25+
unsound = "workspace"
1926
# Ignore known, accepted-risk advisories here. Each entry is the advisory ID
2027
# from https://rustsec.org/advisories/.
2128
ignore = []
22-
# CI must fail when an advisory is rated HIGH or CRITICAL.
23-
severity-threshold = "HIGH"
2429

2530
[licenses]
26-
# Refuse any crate that does not carry a license identifier.
27-
unlicensed = "deny"
31+
# cargo-deny v0.20+ is deny-by-default: anything not in `allow` is denied.
2832
# Allow-listed SPDX identifiers — all transitive dependencies must be covered
2933
# by one of these. Add others when a new dependency introduces a license not
30-
# already listed here. OSI-approved / FSF-free / commonly-used OSS licenses
34+
# already listed here. OSI-approved / FSF-free / commonly-used OSS licenses
3135
# are preferred; proprietary or copy-left licenses should be reviewed before
3236
# being added.
3337
allow = [
@@ -44,16 +48,16 @@ allow = [
4448
"OpenSSL",
4549
"MPL-2.0",
4650
]
47-
# Explicitly refused licenses. Leave empty — un-allowed licenses are already
48-
# denied, and we prefer that new license introductions fail the build so they
49-
# are consciously reviewed.
50-
deny = []
51-
# Per-crate exceptions may be listed here.
52-
# Example:
53-
# exceptions = [
54-
# { name = "some-crate", allow = ["Unlicense"] },
55-
# ]
56-
exceptions = []
51+
# Confidence threshold for license file detection (0.0 to 1.0).
52+
confidence-threshold = 0.8
53+
# Suppress warnings when an allow-listed license is not used by any crate.
54+
unused-allowed-license = "allow"
55+
# Per-crate exceptions may be listed here for crates that need a license
56+
# not in the global allow-list. Add entries like:
57+
# [[licenses.exceptions]]
58+
# allow = ["Zlib"]
59+
# name = "adler32"
60+
# version = "1.0"
5761

5862
[bans]
5963
# Prevent duplicate versions of the same crate in the dependency graph.
@@ -73,7 +77,7 @@ skip = []
7377
skip-tree = []
7478

7579
[sources]
76-
# Only allow crates published to crates.io. Git / path dependencies should
80+
# Only allow crates published to crates.io. Git / path dependencies should
7781
# be rare and reviewed.
7882
unknown-registry = "deny"
7983
unknown-git = "deny"

0 commit comments

Comments
 (0)