Skip to content

[CTX-1875] chore(build): bump the stale tokio lock entry past RUSTSEC-2026-0386 (bitty#3222) - #3225

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1875/tokio-lock
Nov 17, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1875/tokio-lock

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What the lock carried

Cargo.lock carried a stale tokio entry:

$ grep -A3 '^name = "tokio"' Cargo.lock
name = "tokio"
version = "1.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"

1.53.1 sits inside the affected range of RUSTSEC-2026-0386 (AsyncFd::new /
with_interest / try_new / try_with_interest violate I/O safety; unsound,
memory-corruption). Patched ranges: >= 1.51.6, < 1.52.0 and >= 1.53.3.

Why a lock refresh is the whole fix

No workspace crate resolves tokio today — there is no graph edge to change, only a
stale lock entry that lockfile-based scanners still match:

$ cargo tree -i tokio --offline
warning: nothing to print.

To find dependencies that require specific target platforms, try to use option `--target all` first, and then narrow your search scope accordingly.

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.lock diff

Only the version and checksum lines of that one package move:

diff --git a/Cargo.lock b/Cargo.lock
index c809ba4a..66557bcd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3207,9 +3207,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
 
 [[package]]
 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",
 ]

cargo update reported Updating tokio v1.53.1 -> v1.53.3 and left 11 other
dependencies behind latest, i.e. nothing else was re-resolved.

Advisory evidence

cargo deny check advisories (repo deny.toml; the chrono exception from #3221 is
untouched):

$ cargo deny check advisories
advisories ok
exit=0

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 ok both 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):

Crate:     tokio
Version:   1.53.1
Warning:   unsound
Title:     `AsyncFd::new` and related constructors violate I/O safety
Date:      2026-10-13
ID:        RUSTSEC-2026-0386
---
error: 1 vulnerability found!
warning: 4 allowed warnings found

after:

error: 1 vulnerability found!
warning: 3 allowed warnings found

RUSTSEC-2026-0386 no longer appears. The one remaining vulnerability is the
pre-existing RUSTSEC-2026-0009 (time 0.3.41, >=0.3.47 needs rustc 1.88, above the
workspace MSRV 1.85); it is already an explicit, dated P0-AC-034 ignore in deny.toml
and is out of scope here. Full cargo deny check stays green on all groups:
advisories ok, bans ok, licenses ok, sources ok.

--locked checks (every CI leg runs --locked)

$ cargo metadata --locked --offline --format-version 1 > /dev/null   # exit 0 (no output)

$ cargo check --locked --offline -p bitty-runtime
    Checking bitty-runtime v0.0.44 (.../crates/bitty-runtime)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 16.64s
exit=0

Scope

No source file changed. git status --short after the commit is empty and the commit
touches exactly one file:

$ git diff --stat <base>..HEAD
 Cargo.lock | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

No src/ edit, no Cargo.toml change, no version bump, no deny.toml edit.

Closes #3222

@Xuepoo Xuepoo added chore Chore / maintenance P2 Priority: medium area:security Area: security corpus / audit labels Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36672b1b-ef04-4d50-90d0-780bf6d3e157

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Xuepoo Xuepoo added this to the v0.1.0 milestone Nov 17, 2026

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of deprecated, 0 register constructors (the unsound new/with_interest/try_new/try_with_interest are 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; use AsyncFd::register instead …")] and delegate to unsafe { 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 Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Xuepoo
Xuepoo merged commit 34e5aff into main Nov 17, 2026
21 checks passed
@Xuepoo
Xuepoo deleted the ctx-1875/tokio-lock branch November 17, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:security Area: security corpus / audit chore Chore / maintenance P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[build] Cargo.lock carries tokio 1.53.1 (RUSTSEC-2026-0386) with no reachable graph edge

1 participant