Skip to content

fix(deps): bump rusqlite to 0.41.1 for RUSTSEC-2026-0459 - #555

Merged
AntonBabchenko merged 1 commit into
mainfrom
fix/deps-rusqlite-rustsec-2026-0459
Nov 10, 2026
Merged

AntonBabchenko merged 1 commit into
mainfrom
fix/deps-rusqlite-rustsec-2026-0459

Conversation

@AntonBabchenko

Copy link
Copy Markdown
Owner

Summary

cargo-deny went red on 2026-11-10 (first seen on Weblate PR #554, run 42786224734), so ci-gate blocks every PR, and main's next run would fail the same way. One new RustSec entry:

Crate Entry Kind Action
libsqlite3-sys 0.30.1 (bundles SQLite 3.46.0) ← rusqlite 0.32.1 RUSTSEC-2026-0459 / CVE-2026-119375: SQLite < 3.54.0 can return uninitialized page-cache memory when a database is opened with a sibling -wal of a different page size vulnerability (local, needs the victim to open the files) rusqlite → 0.41.1, which pulls libsqlite3-sys 0.39.1 (SQLite 3.54.1). Patched: libsqlite3-sys >= 0.39.0, first shipped with rusqlite 0.41.

This is a runtime path with an upstream fix, so the fix is the bump; deny.toml is untouched and nothing is ignored.

Where SQLite runs: only the Modrinth App import reader (instances/import/readers/modrinth_app.rs) opens that launcher's app.db read-only. Auto-discovery opens the app.db that Modrinth App itself wrote. The manual "pick a folder" path (launcher_import_inspect_folder → detect_folder → ModrinthAppReader::detect) opens <picked>/../app.db, so a copied folder from someone else can supply a crafted app.db + -wal pair. Query results become profile name/version strings in the import dialog and, on import, in the new instance. Nothing goes over the network.

Changes

  • src-tauri/Cargo.toml: rusqlite = { version = "0.41", default-features = false, features = ["bundled"] }, plus an extended justification comment. 0.41's defaults are cache (adds hashlink; the reader calls prepare, never prepare_cached) and ffi-sqlite-wasm-rs (a wasm32-unknown-unknown-only crate that would still land in the lock and in cargo-deny's all-targets graph). Neither is used, so both are off.
  • src-tauri/Cargo.lock: rusqlite 0.32.1 → 0.41.1, libsqlite3-sys 0.30.1 → 0.39.1, hashlink 0.9.1 and ahash 0.8.12 removed. Their only path was rusqlite's old cache, and hashbrown 0.14.5 loses its ahash edge as a result.
  • No code change. modrinth_app.rs builds as is against 0.41 (see Verification).
  • CHANGELOG: [Unreleased] → ### Security, with the ru twin (### Безопасность) in the same position.

cargo-deny justification

No crate is added; two are removed (772 → 770 packages). rusqlite stays MIT, and libsqlite3-sys stays MIT with public-domain SQLite. bundled still compiles SQLite from vendored C, so there is still no system-sqlite dependency.

API drift 0.32 → 0.41 (release notes for every version read)

  • 0.35: prepare rejects multiple statements and execute rejects a trailing statement. The reader prepares one statement, and the tests use execute_batch, which allows several.
  • 0.38: the statement cache is an optional default feature, and u64/usize ToSql/FromSql are off by default. The reader reads String, Option<String> and Option<i64>.
  • 0.41: edition 2024, MSRV 1.89. Lucerna declares no rust-version, rust-toolchain.toml is stable, and every CI job installs toolchain: stable.
  • No other libsqlite3-sys user: cargo tree -i libsqlite3-sys -e all --target all shows only rusqlite ← lucerna.

Lock hygiene

cargo update -p rusqlite touched only the packages listed above. No unrelated edge moved, so no hand revert was needed. cargo metadata --locked exits 0.

Verification

  • cargo deny check (0.19.8, CI's pin) on the base and the new lock, after an index refresh. Findings diffed by kind + crate: the one advisory error is gone and nothing is added (82 warnings on both sides, same set). Result: advisories ok, bans ok, licenses ok, sources ok.
  • API probe outside the repo: a scratch crate pinned to rusqlite =0.41.1 with the same features, same lock checksums, and read_rows copied verbatim. It compiles with no warnings and reports bundled SQLite 3.54.1. It reads (a) a rollback-journal DB like the unit tests build, with the negative-memory clamp; (b) a WAL DB with an un-checkpointed -wal while the writer still holds it open, which is Modrinth App's own shape; (c) a missing file and a garbage file, which give an empty result without a panic.
  • Lucerna's own compile and the modrinth_app tests are left to CI.

Test plan

libsqlite3-sys 0.30.1 bundles SQLite 3.46, which can return uninitialized
page-cache memory when a database is opened together with a sibling -wal
file of a different page size (CVE-2026-119375). The Modrinth App import
reader opens app.db read-only, including from a folder the user picks, so
the runtime path is reachable. rusqlite 0.41.1 pulls libsqlite3-sys 0.39.1
(SQLite 3.54.1).

default-features = false drops the two 0.41 defaults the reader does not
use: the prepared-statement cache (hashlink) and the wasm32-unknown-unknown
FFI crate. hashlink 0.9.1 and ahash 0.8.12 leave the lock; no other edge
moves (772 -> 770 packages).
@AntonBabchenko
AntonBabchenko merged commit 2fc9059 into main Nov 10, 2026
12 checks passed
@AntonBabchenko
AntonBabchenko deleted the fix/deps-rusqlite-rustsec-2026-0459 branch November 10, 2026 21:09
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