Repository navigation
[CTX-1875] chore(build): bump the stale tokio lock entry past RUSTSEC-2026-0386 (bitty#3222) - #3225
Conversation
…-2026-0386 (bitty#3222)
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 1
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including
|
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review of head a048eed8 (PR #3225, branch ctx-1875/tokio-lock, base main) — verifying the lock-only tokio refresh that closes #3222.
All six checks were run independently in the lane worktree
/mnt/data/Workspace/Projects/bitty-terminal/bitty/.worktrees/ctx-1875-tokio-lock (read-only; git status --short empty, HEAD = a048eed87c9005d336d57442b0ea5a1635ee7687). Builds used a fresh CARGO_TARGET_DIR under scratch, never the worktree's target/.
| # | Check | Result |
|---|---|---|
| 1 | Diff scope is Cargo.lock only, hunk is version+checksum only | PASS |
| 2 | 1.53.3 is in the patched set, 1.53.1 affected, checksum belongs to 1.53.3 | PASS |
| 3 | tokio unreachable on the new head; --locked metadata clean |
PASS |
| 4 | Baseline-vs-head lock scan reproduces; deny-vs-audit honesty stated | PASS |
| 5 | PR/issue hygiene (base, labels, milestone, Closes, cross-ref, #3222 open) | PASS |
| 6 | Nothing pins tokio so the lock-only bump is insufficient | PASS (with note) |
1. Diff scope — PASS
$ git show --stat a048eed8
Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
$ git show --name-only --format='' a048eed8
Cargo.lock
The single hunk moves two lines and nothing else:
name = "tokio"
-version = "1.53.1"
+version = "1.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e"
dependencies = [
"pin-project-lite",The dependency list is untouched, no neighbouring package index shifted, and there is exactly one name = "tokio" entry in the lock (Cargo.lock:3209).
2. Target version and checksum — PASS
From the advisory itself
(~/.cargo/advisory-db/advisory-db-3157b0e258782691/crates/tokio/RUSTSEC-2026-0386.md, db commit 233155b):
patched = [">= 1.51.6, < 1.52.0", ">= 1.53.3"]
unaffected = ["< 0.3.2"]1.53.1 falls in neither set → affected; 1.53.3 is in the patched set. Confirmed empirically against the crate sources, not just the metadata:
tokio-1.53.1/src/io/async_fd.rs: 0 occurrences ofdeprecated, 0registerconstructors (the unsoundnew/with_interest/try_new/try_with_interestare plain safe fns).tokio-1.53.3/src/io/async_fd.rs:908,920,932,944: all four constructors carry#[deprecated(note = "unsound due to lack of I/O safety; useAsyncFd::registerinstead …")]and delegate tounsafe { Self::register(..) }— i.e. the 1.53.3 release really is the fix.
Checksum (the one way this PR could be silently broken) verified by hashing the actual crate archive:
$ sha256sum ~/.cargo/registry/cache/index.crates.io-*/tokio-1.53.3.crate
ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e
$ sha256sum ~/.cargo/registry/cache/index.crates.io-*/tokio-1.53.1.crate
202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed
The new value matches the lock byte-for-byte, and the discarded value matches 1.53.1, so neither line was hand-typed wrong. rust-version = "1.71" in both 1.53.1 and 1.53.3, so the workspace MSRV 1.85 is unaffected.
3. Reachability on the new head — PASS
$ cargo tree -i tokio --offline
warning: nothing to print.
$ cargo metadata --locked --offline --format-version 1 > /dev/null ; echo $?
0
$ cargo check --locked --offline -p bitty-runtime
Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.98s # exit 0
No native build (any CI leg, and CI is --locked everywhere) can observe the version change: there is no tokio node in the resolved graph, and the --locked metadata check exits 0, so the lock is consistent with every manifest.
4. Evidence honesty — PASS
I reproduced both sides rather than taking the quoted output on trust. Baseline = git show origin/main:Cargo.lock (sha256 b52c787f…) copied to scratch; head = the lane worktree lock.
$ cargo audit --file <origin/main Cargo.lock> --no-fetch --db ~/.cargo/advisory-db/advisory-db-3157b0e258782691
Crate: tokio / Version: 1.53.1 / ID: RUSTSEC-2026-0386
error: 1 vulnerability found!
warning: 4 allowed warnings found # exit=1
$ cargo audit --file Cargo.lock --no-fetch --db ~/.cargo/advisory-db/advisory-db-3157b0e258782691
Crate: time / RUSTSEC-2026-0009
Crate: chrono / RUSTSEC-2026-0543
Crate: paste / RUSTSEC-2024-0436
Crate: ttf-parser / RUSTSEC-2026-0192
error: 1 vulnerability found!
warning: 3 allowed warnings found # exit=1
grep -c RUSTSEC-2026-0386 on the head output = 0, and the string tokio does not appear at all. Both runs exit 1, and both do so because of the pre-existing time RUSTSEC-2026-0009 (patched ≥0.3.47 needs rustc 1.88 > MSRV 1.85, already a dated ignore at deny.toml:55) — the PR body does not claim exit 0 and its quoted counts (1/4 → 1/3) match my run exactly, so the numbers are not laundered.
cargo deny check advisories is not evidence here, and the PR body says so in its own words ("cargo-deny scans the resolved graph, and tokio has no node there, so this check reads ok both before and after the change"). I confirmed the non-discrimination: it prints advisories ok, exit 0 on the head tree, and its ignore list at deny.toml:55 swallows RUSTSEC-2026-0009/0192/0436/0543, so it could not have surfaced the remaining lock finding either. Treating the audit delta as the real before/after is the correct call.
5. Issue / PR hygiene — PASS
$ gh api repos/bitty-terminal/bitty/pulls/3225
base=main head=a048eed87c9005d336d57442b0ea5a1635ee7687 draft=false mergeable=true
labels=[chore, P2, area:security] milestone=v0.1.0 body ends with "Closes #3222"
$ gh api repos/bitty-terminal/bitty/issues/3222/timeline
[{event: cross-referenced, src: 3225, src_state: open, ...}]
$ gh api repos/bitty-terminal/bitty/issues/3222 → state: open # correct: closes on merge
CI at review time: Supply chain (deny/audit) pass (31s), MSRV 1.85 check pass (1m50s), AUR source build (Arch, real makepkg) pass, Extension pin drift pass, VM tier (PR) pass; Analyze (rust), the Linux Wayland/X11 legs, Quality gates, Windows and macOS were still pending when I reviewed, so the merge guard should wait for them rather than treat this comment as a CI waiver.
6. Residuals — PASS, one documentation nit
cargo tree -i tokio --offline prints nothing, but --target all does surface a theoretical edge:
$ cargo tree --target all -i tokio --offline
tokio v1.53.3
└── wasm-bindgen-futures v0.4.79
└── winit v0.30.13 (…/vendor/winit)
└── bitty-platform v0.0.44
That edge is [target.'cfg(all(target_os = "emscripten", wasm_bindgen_unstable_tokio))'.dependencies.tokio] with version = "1" (wasm-bindgen-futures-0.4.79/Cargo.toml:62-68), and cargo tree -i tokio --target wasm32-unknown-unknown --offline again prints "nothing to print". So it is unsatisfiable for any target the workspace or CI builds — there is no wasm32/emscripten reference anywhere in .github/workflows/ or scripts/. The "1" requirement already admits 1.53.3, there is no [patch] entry for tokio (root Cargo.toml patches only winit and bitty-pty/bitty-plugin-host), and deny.toml contains no tokio pin. The lock-only bump is therefore sufficient on every platform target; nothing pins tokio below the patched range.
Non-blocking nit for the body: "there is no graph edge to change" is marginally stronger than what --target all shows; "no edge for any target the workspace or CI actually builds" would be exact. The body even quotes cargo's --target all hint without running it. This does not affect the fix, the evidence, or the checksum, so I am not blocking on it.
Scope: Cargo.lock only, 2 insertions / 2 deletions, correct patched version, correct checksum, honest before/after evidence, hygiene complete, no residual platform exposure. Nothing here warrants a change request.
VERDICT: APPROVE
Xuepoo
left a comment
There was a problem hiding this comment.
Guard note: corrected reachability phrasing (review residual, non-blocking)
The independent review (review id 5940906343, head a048eed8) returned VERDICT: APPROVE with one
non-blocking residual about this PR body's wording:
"No workspace crate resolves tokio today — there is no graph edge to change" is marginally stronger
than reality.
Measured, accurate phrasing:
$ cargo tree -i tokio --offline -> warning: nothing to print.
$ cargo tree --target all -i tokio --offline
tokio v1.53.3 <- wasm-bindgen-futures 0.4.79 <- winit 0.30.13 (vendor/winit) <- bitty-platform
That single edge exists only under
[target.'cfg(all(target_os = "emscripten", wasm_bindgen_unstable_tokio))'.dependencies] version = "1"
(wasm-bindgen-futures-0.4.79/Cargo.toml:62-68); cargo tree -i tokio --target wasm32-unknown-unknown
prints nothing, and no workflow or script in the repo references wasm32/emscripten. So the correct claim
is: no graph edge for any target the workspace or CI builds, and the "1" requirement already admits
1.53.3 — the lock-only bump still cannot change any build output.
Nothing else changed: the reviewed diff is still the two tokio lines in Cargo.lock.
What the lock carried
Cargo.lockcarried a staletokioentry:1.53.1 sits inside the affected range of RUSTSEC-2026-0386 (
AsyncFd::new/with_interest/try_new/try_with_interestviolate I/O safety; unsound,memory-corruption). Patched ranges:
>= 1.51.6, < 1.52.0and>= 1.53.3.Why a lock refresh is the whole fix
No workspace crate resolves
tokiotoday — there is no graph edge to change, only astale lock entry that lockfile-based scanners still match:
So this PR adds no dependency and removes no entry by hand: it re-pins the existing
entry into the patched range with
cargo update -p tokio --precise 1.53.3 --offline.The exact
Cargo.lockdiffOnly the
versionandchecksumlines of that one package move:cargo updatereportedUpdating tokio v1.53.1 -> v1.53.3and left 11 otherdependencies behind latest, i.e. nothing else was re-resolved.
Advisory evidence
cargo deny check advisories(repodeny.toml; the chrono exception from #3221 isuntouched):
Note on what that verdict does and does not prove: cargo-deny scans the resolved graph,
and tokio has no node there, so this check reads
okboth before and after the change.The lock-based view is the one that actually carried the defect, so the before/after
there is the meaningful evidence —
cargo audit --file Cargo.lock --no-fetch:before (HEAD~1 lock):
after:
RUSTSEC-2026-0386 no longer appears. The one remaining
vulnerabilityis thepre-existing
RUSTSEC-2026-0009(time0.3.41,>=0.3.47needs rustc 1.88, above theworkspace MSRV 1.85); it is already an explicit, dated P0-AC-034 ignore in
deny.tomland is out of scope here. Full
cargo deny checkstays green on all groups:advisories ok, bans ok, licenses ok, sources ok.--lockedchecks (every CI leg runs--locked)Scope
No source file changed.
git status --shortafter the commit is empty and the committouches exactly one file:
No
src/edit, noCargo.tomlchange, no version bump, nodeny.tomledit.Closes #3222