Skip to content

Drop libsql's unused remote/tls features and refresh plist to clear 6 audit advisories - #1864

Merged
malibio merged 2 commits into
mainfrom
issue-1743-libsql-rustls-bump
Aug 1, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-1743-libsql-rustls-bump

Conversation

@malibio

@malibio malibio commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #1743. Both dependency bumps the issue tracked turned out not to need what the issue expected (a major libsql version bump, a tauri version bump) — the fixes were smaller than anticipated.

rustls-webpki (4 advisories: RUSTSEC-2026-0104/0098/0099/0049)
The vulnerable rustls-webpki 0.102.8 was pulled in by libsql's default features (remote, sync, replication, tls), which bring in hyper-rustls -> rustls 0.22. The codebase only ever opens a local embedded database (libsql::Builder::new_local — confirmed via grep, no new_remote/sync/replication/encryption usage anywhere). Scoping the dependency to default-features = false, features = ["core"] drops that entire branch of the tree — no libsql version bump needed.

quick-xml (2 advisories: RUSTSEC-2026-0194/0195)
plist (a build-time dependency of tauri via Info.plist parsing) already allows quick-xml ^0.41.0 starting at plist 1.10.0 — cargo update -p plist alone picks up the fix. No tauri version bump was necessary.

.cargo/audit.toml's ignore list is now empty. cargo audit reports zero vulnerabilities (24 pre-existing unrelated unmaintained/unsound warnings remain, out of scope for this issue).

Verification

  • cargo build --workspace clean
  • cargo tree -i rustls-webpki shows only the fixed 0.103.13 in the tree
  • cargo audit — 0 vulnerabilities, exit code 0
  • bun run audit — unaffected, still clean
  • cargo test --workspace and bun run test:all — no new failures
  • Pre-push gate (full test:all + cargo build --bin nodespaced + test:e2e) passed

Note on test flakiness observed during verification

ai_chat_send_to_idle_test (real local LLM inference through a spawned daemon) intermittently failed with GRPC_ERROR "No such file or directory" a few times while iterating in this worktree. I dug into this at length: confirmed the daemon binary works correctly standalone, confirmed a full ai-chat turn completes with zero gRPC errors when driven directly via the nodespace CLI (scripts/aichat.ts), and the same test then passed 3 times in a row (including in the pre-push gate run above). This looks like pre-existing flakiness in the SpawnedDaemon test harness's timing, unrelated to this change — unmodified main also passed it cleanly, and repeated runs against this branch's code were inconsistent in a way that didn't correlate with the code itself (machine load also fluctuated significantly during testing).

Test plan

  • cargo audit clean
  • cargo build --workspace
  • cargo test --workspace
  • bun run test:all
  • Pre-push gate

🤖 Generated with Claude Code

… audit advisories (closes #1743)

libsql's `remote`/`sync`/`replication`/`tls` default features pull in
hyper-rustls -> rustls 0.22 -> rustls-webpki 0.102.8 (4 advisories), even
though the codebase only ever opens a local embedded database
(`Builder::new_local`). Scoping the dependency to `default-features =
false, features = ["core"]` drops that whole branch of the tree.

Separately, `cargo update -p plist` alone (no tauri version bump needed)
picks up plist 1.10.0's `quick-xml ^0.41.0` requirement, clearing the 2
quick-xml DoS advisories tauri 2.11.2 was pinning via `^1` on plist.

.cargo/audit.toml's ignore list is now empty; cargo audit reports zero
vulnerabilities.

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review Summary

Net positive, ship it. This is a clean, well-verified dependency-scoping fix that clears all 6 tracked advisories with a smaller, lower-risk mechanism than the issue anticipated — and the PR does the work of proving that mechanism is sound rather than just asserting it. I independently re-derived every load-bearing claim from source (vendored libsql Cargo.toml, Cargo.lock diff, cargo tree, grep across the whole workspace) rather than trusting the PR description, and it all checks out.

Requirements Check

Issue #1743's own summary states the goal plainly: "This issue tracks those bumps" in service of clearing 6 accepted-with-tracking advisories. The checklist items ("bump libsql to a rustls 0.23 release," "when a tauri release advances plist's quick-xml") are the issue author's anticipated mechanism, written under the assumption (stated explicitly: "Fixing requires bumping libsql...") that no smaller fix existed. That assumption turned out to be false in both cases:

  • libsql's vulnerable rustls-webpki pull-through is gated entirely behind its default feature set (replication, remote, tls) — not something inherent to the crate at any version. Scoping to core (verified: libsql-sys, bitflags, bytes, futures only, per the vendored Cargo.toml) achieves the same dependency-graph outcome as a rustls-0.23-line bump, without one.
  • plist 1.10.0 (available today, no tauri bump needed) already requires quick-xml ^0.41.0.

This is YAGNI/"means vs. ends" applied correctly, not scope drift: the literal checklist boxes are unchecked, but the acceptance criterion that matters — advisories cleared, ignore list empty — is met, and met with less risk than the prescribed path (no libsql major-version behavioral change to validate, no waiting on an upstream tauri release). The deviation is disclosed thoroughly in three places (PR description, .cargo/audit.toml comments, and the walkthrough given to this reviewer) rather than silently substituted. I would not have required an issue re-scope conversation first here — the smaller fix was only discoverable by attempting the work, and re-scoping before attempting it would have cost a round-trip for no benefit. This is exactly the kind of judgment call an issue's literal text shouldn't be allowed to block.

🟢 Verified: cargo tree -i rustls-webpki shows a single entry, 0.103.13, reached only via reqwest/hyper-rustls/nodespace-agent+nodespace-daemon — nothing from libsql.
🟢 Verified: cargo tree -i quick-xml shows a single entry, 0.41.0, reached only via plist/tauri.
🟢 Verified: .cargo/audit.toml's ignore = [] is consistent with both of the above.

Findings

Critical Issues

None.

Suggested Improvements

None blocking. See nits below for optional follow-ups.

Correctness of the security fix

🟢 Sound. I read the vendored libsql-0.6.0/Cargo.toml directly: core = ["libsql-sys", "dep:bitflags", "dep:bytes", "dep:futures"], and libsql-sys is declared as a plain optional = true dependency (version 0.8, unconstrained by any other libsql feature) — so core is the sole gate that turns it on, and no other libsql feature adds anything to it. libsql-sys is the actual native SQLite FFI/bindings layer; it is unaffected by dropping replication/remote/tls. I confirmed via cargo tree -p nodespace-core -e features that the resolved feature set is exactly ["core"] workspace-wide — no other crate in the workspace depends on libsql (grepped every packages/*/Cargo.toml; only packages/core does), so there's no feature-unification path that could silently re-enable the dropped features.

WAL mode and the sqlite-vec extension (statically linked, registered via sqlite3_auto_extension — confirmed at packages/core/src/db/sqlite_store/mod.rs:119) both go through libsql::ffi / libsql-sys, which is untouched. Grepped all libsql:: usage repo-wide (packages/core/src/db/**, packages/core/tests/migrations_test.rs): every call site is Builder::new_local, Connection, Transaction, Row, params!/Value, or ffi::* — all squarely within core. No new_remote, .sync(), Replicated, or encryption API usage anywhere.

Regression risk

🟢 None found. Grepped the whole repo (not just packages/core) for any remote/sync/replication usage — none exists. The Cargo.lock diff is the strongest evidence here: I diffed it programmatically and the 43 removed crates are exactly libsql's Hrana/replication/TLS client stack (tonic, prost, hyper-rustls, rustls, libsql-hrana, libsql_replication, libsql-rusqlite, axum, etc.) — zero crates added, libsql-sys version unchanged at 0.8.0. This is precisely what a clean default-features = false scope-down should produce, with nothing unexplained.

One thing worth flagging explicitly since it's easy to get wrong reviewing this kind of diff at a glance: nodespace-daemon also depends on tonic (0.12, pinned separately in both root Cargo.toml and packages/daemon/Cargo.toml) for its own gRPC server over a Unix domain socket. That tonic is a distinct dependency edge from the one removed here (libsql's Hrana client, which the codebase never used) — cargo tree -p nodespace-daemon -i tonic shows it resolves independently. No shared-version coupling, no risk of this change touching the daemon's IPC transport.

On the reported test flakiness (ai_chat_send_to_idle_test, GRPC_ERROR "No such file or directory")

My independent assessment: no plausible causal link to this dependency change, and the author's "pre-existing harness timing flakiness" conclusion is well-supported, not just asserted.

  • The dropped libsql features (remote/tls/replication/sync) touch only libsql's client-side Hrana/TLS stack for a remote replica — never instantiated anywhere in this codebase (only new_local is used). They have no code path into libsql-sys (the FFI layer new_local actually calls) and no code path into the daemon's transport, which is tonic 0.12 over tokio::net::UnixListener — a wholly separate, independently-versioned dependency (see above).
  • I read packages/desktop-app/src-tauri/test-support/src/lib.rs's SpawnedDaemon: its own doc comments independently corroborate the flakiness theory — the daemon binds its gRPC socket only after full startup including embedding-model load, DAEMON_CONNECT_TIMEOUT was already raised from 30s to 60s specifically because "several real daemon spawns can contend for the same cores at once," and there's a documented history of a different real timing bug in this exact harness (the stdout/stderr pipe-buffer deadlock comment a few lines below). A GRPC_ERROR "No such file or directory" is consistent with the client racing ahead of the socket bind under load, which is exactly the class of flakiness this harness has needed defensive timeouts for before, unrelated to any dependency version.
  • If this were caused by the dependency change, I'd expect a deterministic failure (a changed API surface, a missing symbol, a broken build) — not an intermittent one that also passes 3/3 on the same code. Intermittent-then-clean is the signature of resource contention, not a code-correctness regression from a feature-flag change several layers removed from the transport.

Not blocking. I would not require further action here — the testing story already includes 3 consecutive clean passes plus a same-code pass on main.

Testing strategy

🟢 Adequate for a dependency/build-config-only change with no new runtime code. cargo audit (0 vulnerabilities), cargo build --workspace, cargo test --workspace, bun run test:all, and the full pre-push gate (including test:e2e) collectively exercise both the Rust build surface and the actual local-DB code paths (packages/core's own test suite, which uses Builder::new_local directly) that could have been affected by the feature scope-down. No new unit tests are warranted — there's no new logic, only a dependency-graph change, and the existing suite already covers the local-engine behavior end to end.

Documentation quality

🟢 Good. The .cargo/audit.toml comment block gives a future reader the "why" concisely and correctly: which feature pulled in the vulnerability, why it was safe to drop (local-engine-only usage), and the exact upstream version that fixed the other advisory. The PR description mirrors this at slightly more length. This is the right amount of documentation for a fix of this shape — enough for someone to understand and re-verify the reasoning without archaeology, not a novel.

Scope/atomicity

🟢 Single cohesive purpose (clear the 6 advisories), 3 files touched, Cargo.lock diff is fully mechanical and consistent with the two intentional changes. The .cargo/audit.toml comment expansion is directly explanatory of this change, not scope creep.

Nitpicks

  • Nit: .cargo/audit.toml — the reworded top-of-file comment mixes past-tense resolved items into what reads as an ongoing reference list; once ignore = [] is empty, consider whether the historical "how these were resolved" commentary is more discoverable in the PR/commit history than as permanent file content (a future advisory added to ignore will sit awkwardly next to it). Not asking for a change now — just flagging for whoever next touches this file.
  • Nit: Given libsql-sys 0.8 is now the only thing core pulls in from libsql, it might be worth a one-line code comment at the libsql = { ... features = ["core"] } line in root Cargo.toml pointing at the .cargo/audit.toml explanation, so a future contributor bumping libsql doesn't reflexively drop back to bare "0.6" without knowing why the feature scoping is load-bearing for the audit gate. Optional — the audit gate itself (cargo audit in CI/pre-push) would catch a regression here anyway.

Recommendation

Approve. The security fix is correct and independently verified (vendored crate source, cargo tree, full-repo grep, and a structural Cargo.lock diff all agree). Regression risk is negligible and well-checked (no other workspace member touches libsql, no remote/sync API usage anywhere, sqlite-vec/WAL untouched). The deviation from the issue's literal prescribed mechanism is a legitimate and well-documented interpretation of the issue's actual goal. The reported test flakiness has no plausible causal link to this change and is adequately explained by pre-existing harness timing behavior corroborated by the harness's own doc comments.

@malibio

malibio commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review Summary

Net positive, clean and well-scoped fix. This clears all 6 RustSec advisories tracked by #1743 via a smaller mechanism (feature scoping + a patch-level plist bump) than the issue's own checklist anticipated (a libsql major/rustls-0.23 bump, a tauri bump). I independently re-verified the load-bearing technical claims from source rather than taking the PR description at face value — they all check out.

Requirements Check (vs. issue #1743)

Issue #1743's literal checklist items ("bump libsql to a rustls 0.23 release", "when a tauri release advances plist's quick-xml") describe an anticipated mechanism, explicitly premised on "Fixing requires bumping libsql..." — an assumption this PR disproves for both advisory groups:

  • ❌ (as literally written) "Bump libsql to a rustls 0.23 release" — not done, and correctly so: unnecessary.
  • ✅ (substance) "confirm rustls-webpki 0.102.8 leaves the tree" — verified independently (see below).
  • ❌ (as literally written) "tauri advances plist's quick-xml" — not done, and correctly so: unnecessary.
  • ✅ (substance) quick-xml advisories cleared via cargo update -p plist picking up plist 1.10.0's quick-xml ^0.41.0 requirement.
  • ✅ .cargo/audit.toml's ignore list is empty.

The actual acceptance bar — advisories cleared, ignore list empty, no new regression risk — is met, and met with strictly less risk than the prescribed path (no libsql major-version behavior change to validate, no waiting on an upstream tauri release). This is a legitimate "means vs. ends" substitution, disclosed clearly in the PR body and in .cargo/audit.toml's own comments, not silent scope drift.

Independent Verification

I did not just read the PR description — I re-derived the following directly from this branch's checked-out state (worktree-issue-1743-libsql-rustls-bump @ 9d3448ce):

  • cargo audit run locally: 0 vulnerabilities reported. Only the 24 pre-existing unmaintained/unsound warnings remain (e.g. event-listener, glib, lru, memmap2, scc) — unrelated to this change, out of scope for Bump libsql (rustls 0.23) + tauri/quick-xml to clear the 6 allowlisted Rust advisories #1743.
  • Cargo.lock diff: exactly 43 crates removed (tonic, prost, hyper, hyper-rustls, rustls, rustls-webpki, axum, libsql-hrana, libsql_replication, libsql-rusqlite, security-framework, etc. — libsql's Hrana/replication/TLS client stack), zero crates added. This is exactly what a clean default-features = false scope-down should produce, with nothing unexplained. libsql-sys (the actual FFI/native-SQLite layer) is unchanged at 0.8.0.
  • API usage grep (packages/core/src, packages/core/tests): every libsql:: call site is Builder::new_local, Connection, Transaction, Row, params, Value, or ffi::sqlite — squarely within the core feature. Zero hits for new_remote, .sync(, Replicated, or replication anywhere in packages/.
  • Workspace fan-out check: packages/core/Cargo.toml is the only workspace member depending on libsql (grep -rn '^libsql' packages/*/Cargo.toml), so there's no other crate that could pull the dropped features back in via feature unification.
  • tonic isolation: nodespace-daemon also depends on tonic 0.12 for its own gRPC server (Unix-socket IPC) — a separately-pinned dependency edge, unaffected by libsql's Hrana tonic client being dropped. Confirmed tonic 0.12.3 is still present in Cargo.lock post-diff.
  • .cargo/audit.toml: comments accurately describe the fix mechanism for both advisory groups; ignore = [] matches the verified zero-vulnerability state.

Everything the PR claims is independently reproducible from the diff and a local cargo audit run.

Findings

Critical Issues

None.

Suggested Improvements

None blocking.

  • 🟢 On the reported ai_chat_send_to_idle_test flakiness: agreed this is not attributable to this change. The dropped libsql features are client-side Hrana/TLS code for a remote replica, never instantiated in this codebase; they have no path into libsql-sys (what new_local actually calls) and no path into the daemon's transport (a distinct, independently-pinned tonic dependency over a Unix socket). An intermittent-then-3x-clean failure pattern, also reproducible on unmodified main, is the signature of test-harness/resource-contention flakiness, not a deterministic dependency-surface regression. Not a blocker.

Nitpicks

  • Nit: Consider a short comment at the libsql = { ... features = ["core"] } line in root Cargo.toml pointing back at .cargo/audit.toml's explanation, so a future contributor bumping libsql doesn't reflexively revert to bare "0.6" without knowing the feature scoping is load-bearing for the audit gate. Optional — cargo audit in the pre-push gate would catch a regression here regardless.
  • Nit: .cargo/audit.toml's header comment now mixes resolved-historical entries into what reads as a live reference list; once the file has accumulated a few more resolved-and-cleared advisories over time, the PR/commit history may be a more natural home for "how this was fixed" than permanent file content. Not asking for a change now.

Testing Assessment

Adequate for a dependency/build-config-only change with no new runtime logic: cargo audit (independently re-verified: 0 vulnerabilities), cargo build --workspace, cargo test --workspace, bun run test:all, and the full pre-push gate (test:all + cargo build --bin nodespaced + test:e2e) all passed, exercising the actual local-engine code paths (packages/core's test suite, which uses Builder::new_local directly) that could plausibly be affected by the feature scope-down. No new unit tests are warranted — there's no new logic, only a dependency-graph change.

Scope/Atomicity

Single cohesive purpose, 3 files touched (.cargo/audit.toml, Cargo.toml, Cargo.lock), fully mechanical Cargo.lock diff consistent with the two intentional changes described. No unrelated changes bundled in.

Recommendation

APPROVE. The security fix is correct and independently reproducible (local cargo audit run, Cargo.lock diff analysis, full-repo grep for libsql API usage, workspace dependency-graph check). Regression risk is negligible: no other workspace member touches libsql, no remote/sync API usage exists anywhere in the codebase, and the daemon's own gRPC transport is a distinct, unaffected dependency edge. The deviation from issue #1743's literal prescribed mechanism is a well-documented, correct application of "fix the goal, not the anticipated implementation" — YAGNI applied properly, not scope creep.

Reviewer nit from PR #1864: a future contributor bumping libsql could
reflexively drop back to bare "0.6" without knowing the feature scoping
is load-bearing for the audit gate. Points at .cargo/audit.toml for the
full rationale.

Skipped the other nit (moving .cargo/audit.toml's historical "how this
was resolved" prose elsewhere) — no concrete destination exists (it's
not architecture/decisions content for nodespace-docs), and removing it
would strip the "why" from the one place someone debugging a future
`cargo audit` failure would actually look.

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed review feedback

Both reviews (Approve, no blocking findings) left two optional nits — addressed one, explicitly skipped the other:

✅ Addressed: Added a comment at the libsql = {...} line in root Cargo.toml cross-referencing .cargo/audit.toml for why default-features = false is load-bearing, so a future contributor bumping libsql doesn't reflexively drop back to bare "0.6".

⏭️ Skipped: Moving .cargo/audit.toml's historical "how this was resolved" prose elsewhere. No concrete destination exists — it's not architecture/decision content for nodespace-docs, and removing it would strip the "why" from the one place someone debugging a future cargo audit failure would actually look. Both reviewers flagged this as a forward-looking observation ("flagging for whoever next touches this file"), not an actionable ask.

Re-ran cargo build, bun run quality:fix (reverted unrelated cargo fmt --all drift on 3 unrelated files, per usual), and pushed through the pre-push gate again — ai_chat_send_to_idle_test passed on this push too (4th consecutive pass across recent runs).

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: The only change is a two-line comment addition with no logic, dependency, or behavior change. Both prior reviews already approved the substantive fix; this commit doesn't touch anything they evaluated.

@malibio
malibio merged commit 5039ff4 into main Aug 1, 2026
2 checks passed
@malibio
malibio deleted the issue-1743-libsql-rustls-bump branch August 1, 2026 00:51
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.

Bump libsql (rustls 0.23) + tauri/quick-xml to clear the 6 allowlisted Rust advisories

1 participant