Skip to content

fix(deps): clear seven RustSec advisories in rustls and zip - #426

Merged
hyperb1iss merged 4 commits into
mainfrom
nova/deny-advisories
Oct 18, 2026
Merged

hyperb1iss merged 4 commits into
mainfrom
nova/deny-advisories

Conversation

@hyperb1iss

@hyperb1iss hyperb1iss commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Cargo Deny has been red on main since seven new RustSec advisories reached the advisory database: four against rustls 0.23.45 and three against zip 8.6.0. Every open PR inherits the failure. With this change, cargo deny check passes all four sections, and deny.toml still has no advisory ignores.

What this changes

Rustls moves from 0.23.45 to 0.23.46. The lockfile diff is that one package, and every TLS client in the daemon picks it up (reqwest, tokio-rustls, tungstenite, the Hue driver's DTLS stack, and Servo's networking).

Zip moves from 8.6.0 to 9.0.5, which takes more work. Zip is only a build dependency of utoipa-swagger-ui, the crate that serves Swagger UI at /api/v1/docs. Its newest release (10.0.1) requires zip ^8.6, and only zip 9 fixes the advisories, so cargo update cannot reach a fixed version. Upstream merged the move to zip 9 on 2026-10-17 (juhaku/utoipa#1645) but has not released it. This PR vendors utoipa-swagger-ui 10.0.1 under vendor/utoipa-swagger-ui/ through [patch.crates-io], following the vendor/servo-script pattern, and applies upstream's two-line patch on top.

Why

Advisory Crate Issue
RUSTSEC-2026-0346 rustls Debug impls on client session values print TLS secrets
RUSTSEC-2026-0347 rustls Buffered application data reaches the outer server after an ECH rejection
RUSTSEC-2026-0348 rustls Brotli certificate decompression can allocate up to 1 GiB before authentication
RUSTSEC-2026-0349 rustls An unauthenticated ServerHello can downgrade later connections to classical key exchange
RUSTSEC-2026-0367 zip SUID and SGID bits survive extraction
RUSTSEC-2026-0368 zip ZipArchive::extract writes symlinks that point outside the destination
RUSTSEC-2026-0369 zip Extraction applies permissions through symlinks

None of the zip advisories was reachable here. The build script copies entries out of the Swagger UI archive pinned inside utoipa-swagger-ui-vendored itself and never calls the affected extract APIs. We fix them anyway so the graph stays clean without ignores.

Verification

  • Added or updated tests
  • Added or updated docs (README, AGENTS.md, relevant spec, or guide): vendor/utoipa-swagger-ui/HYPERCOLOR.md and NOTICE
  • just verify passes locally (Rust fmt + lint + test): not run in full; the targeted checks below ran instead
  • just deny passes (required for dependency or license changes)
Check Result
cargo deny check advisories on main (01136d87c) FAILED with exactly the seven advisories above
cargo deny check on this branch advisories, bans, licenses, and sources all ok. The remaining warnings (yanked yoke-derive, duplicate versions) were already there
cargo check --workspace --locked Clean. Cargo does not cap lints for a non-workspace path dependency, and the vendored crate emits no warnings
cargo build -p hypercolor-daemon --locked Builds. The vendored build script unpacked the Swagger UI 5.32.6 bundle with zip 9.0.5
cargo test -p hypercolor-daemon --test openapi_tests 6 of 6 pass, including swagger_ui_is_served
cargo test -p hypercolor-daemon --lib swagger static_assets_and_swagger_ui_do_not_need_an_api_key passes
scripts/check-vendored-patches.sh 3 crates resolve to vendor/ (servo-script, tachys, utoipa-swagger-ui)
cargo fmt --all --check Clean

The build and tests ran before the rebase onto 7aad243e9. That rebase pulled in #416 and #417, which touch no manifest or lockfile, and cargo deny check, the vendor guard, and cargo metadata --locked reran on the rebased head.

Notes for reviewers

Review the vendor commit by commit. The first one (4e8e2b05c) adds the published crate exactly as utoipa-swagger-ui-10.0.1.crate unpacks, and its checksum (3f5ec9d7) matches the lockfile entry it replaces. The second one (3055ee738) changes two lines: the zip requirement in Cargo.toml becomes 9.0, and build.rs adds a ? because zip 9's ZipFile::name returns a Result. After that commit, build.rs and every file under src/ are byte-identical to upstream at 5aff30b, so the vendor holds no code of ours to carry forward when a release ships.

The vendor has a built-in exit. scripts/check-vendored-patches.sh already reads every [patch.crates-io] path entry, so any update that moves utoipa-swagger-ui past 10.0.1 (Dependabot's monthly group or a hand bump) fails CI until the same change deletes the vendor. HYPERCOLOR.md spells out that rule.

I ruled out two alternatives. A deny.toml ignore would suppress the advisories instead of fixing them. A git patch pointing at upstream master would drag utoipa itself onto unreleased code, because the swagger crate's manifest names it through a path dependency. Master carries about a dozen commits since the release, roughly half of them schema-generation changes that would shift the generated OpenAPI document.

Supporting wiring: the vendor directory is excluded from the workspace, listed in NOTICE, kept out of prettier, and added to the CI rust paths filter, so a change that touches only the vendored source still runs Rust CI.

🤖 Generated with Claude Code

hyperb1iss and others added 3 commits October 17, 2026 16:50
rustls 0.23.45 is flagged by RUSTSEC-2026-0346 (Debug impls on client
session values print TLS secrets), RUSTSEC-2026-0347 (buffered
application data reaches the outer server after an ECH rejection),
RUSTSEC-2026-0348 (Brotli certificate decompression can allocate up to
1 GiB before authentication), and RUSTSEC-2026-0349 (an unauthenticated
ServerHello can downgrade later connections to classical key exchange).
All four are fixed in 0.23.46.

This is a lockfile-only patch bump. rustls reaches the daemon through
reqwest, tokio-rustls, tungstenite, the Hue driver's DTLS stack, and
Servo's networking, so every TLS client in the process picks up the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
utoipa-swagger-ui 10.0.1, the newest release, pins its build-time zip
dependency to ^8.6. zip 8.6.0 carries RUSTSEC-2026-0367, 0368, and 0369,
and only zip 9 fixes them, so no cargo update can clear the advisories.
Upstream merged the move to zip 9 (juhaku/utoipa#1645, commit 5aff30b)
on 2026-10-17 but has not released it.

This commit vendors the published 10.0.1 crate byte for byte, with
checksum 3f5ec9d7 matching the lockfile, and swaps it in through
[patch.crates-io], the same way vendor/servo-script works. It carries no
source edits; the zip patch lands in the next commit so the vendor's
history shows every change against the published crate.

The crate is excluded from the workspace, listed in NOTICE, kept out of
prettier, and added to the CI rust paths filter so a change that touches
only the vendored source still runs Rust CI.
scripts/check-vendored-patches.sh already picks up the new patch entry
and fails CI once a bump moves the crate off 10.0.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
zip 8.6.0 is flagged by RUSTSEC-2026-0367 (SUID and SGID bits survive
extraction), RUSTSEC-2026-0368 (ZipArchive::extract writes symlinks that
escape the destination), and RUSTSEC-2026-0369 (extraction applies
permissions through symlinks). zip 9.0.0 is the first fixed release, and
the lockfile now takes 9.0.5.

The vendored utoipa-swagger-ui carries upstream's own fix from
juhaku/utoipa#1645 (merge commit 5aff30b): the build dependency moves to
zip 9.0, and build.rs adds a `?` because ZipFile::name now returns a
Result. After the patch, build.rs and every file under src/ match
upstream at 5aff30b byte for byte, so the vendor can be dropped as soon
as a release ships it. vendor/utoipa-swagger-ui/HYPERCOLOR.md records
the patch and the removal rule.

zip is only a build dependency here, and the build script copies entries
out of a pinned Swagger UI archive itself instead of calling the affected
extract APIs, so none of the three was reachable. Fixing it keeps the
graph clean and lets cargo deny pass with no advisory ignores.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 18 billable files and costs up to $4.50.

Or wait 35 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c0795dd-753b-411c-abc5-8cfd97bd6411
📥 Commits

Reviewing files that changed from the base of the PR and between 7aad243 and ac33a69.

⛔ Files ignored due to path filters: 2
  • Cargo.lock is excluded by !**/*.lock
  • vendor/utoipa-swagger-ui/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 18
  • .github/workflows/ci.yml
  • .prettierignore
  • Cargo.toml
  • NOTICE
  • vendor/utoipa-swagger-ui/.cargo_vcs_info.json
  • vendor/utoipa-swagger-ui/CHANGELOG.md
  • vendor/utoipa-swagger-ui/Cargo.toml
  • vendor/utoipa-swagger-ui/Cargo.toml.orig
  • vendor/utoipa-swagger-ui/HYPERCOLOR.md
  • vendor/utoipa-swagger-ui/LICENSE-APACHE
  • vendor/utoipa-swagger-ui/LICENSE-MIT
  • vendor/utoipa-swagger-ui/README.md
  • vendor/utoipa-swagger-ui/build.rs
  • vendor/utoipa-swagger-ui/src/actix.rs
  • vendor/utoipa-swagger-ui/src/axum.rs
  • vendor/utoipa-swagger-ui/src/lib.rs
  • vendor/utoipa-swagger-ui/src/oauth.rs
  • vendor/utoipa-swagger-ui/src/rocket.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

An independent review of the vendor caught wording errors. The removal
rule pointed at patches "below" when they sit above it; the upstream
status credited the published changelog with an "Unreleased" entry that
only exists in upstream's changelog at 5aff30b; the daemon's usage
covers the docs UI and the OpenAPI document, not one route; and the
NOTICE entry read as if utoipa itself were at 10.0.1.

The note also says why the packaged Cargo.lock and Cargo.toml.orig still
name zip 8.6: Cargo and cargo deny ignore both when the crate builds as
a dependency, so they stay as published.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hyperb1iss
hyperb1iss merged commit 4175428 into main Oct 18, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant