From e948ff7cac2977960e7dccbdfe72032bcedc1905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henrique=20Ara=C3=BAjo?= Date: Fri, 13 Nov 2026 10:34:07 -0300 Subject: [PATCH 1/3] fix(deps): bundle SQLite 3.54.1 (RUSTSEC-2026-0459) SQLite before 3.54.0 can return uninitialized page-cache memory when it opens a database together with a `-wal` file of a different page size (CVE-2026-119375). LowQuery opens SQLite files the user picks, which may come from someone else, and bundles SQLite through rusqlite. rusqlite 0.40 pins libsqlite3-sys 0.38 (SQLite 3.53.2), so this moves to rusqlite 0.41.1 / libsqlite3-sys 0.39.1 (SQLite 3.54.1). In 0.41, `columns()` and `columns_with_metadata()` return iterators, so the three `.iter()` calls go. --- src-tauri/Cargo.lock | 32 ++++++++++++++++---------------- src-tauri/Cargo.toml | 2 +- src-tauri/src/drivers/sqlite.rs | 3 --- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 7036dad..bb8fca2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1154,7 +1154,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1345,7 +1345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2625,9 +2625,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.38.2" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d20bef17f513b9b3004532233187769cd072d790971f4e4da0e346eb6401e8" +checksum = "14a5f01b87b92705d07b433c06f96cbc764637d81a0bffb5734ce17cf0f9a2b3" dependencies = [ "cc", "pkg-config", @@ -2843,7 +2843,7 @@ dependencies = [ "png 0.18.1", "serde", "thiserror 2.0.21", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4043,9 +4043,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.40.2" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f2a97da3e3873c73cb2a2e71b35c40ff95e0b1eefa8d72d8499a6928c3b5b3" +checksum = "da9bba6f3506135e120a6586df05be18b48d18896600646a4bec8f993d91a594" dependencies = [ "bitflags 2.13.2", "fallible-iterator 0.3.0", @@ -4081,7 +4081,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4139,7 +4139,7 @@ dependencies = [ "security-framework 3.7.0", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4689,7 +4689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5345,7 +5345,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5803,7 +5803,7 @@ dependencies = [ "png 0.18.1", "serde", "thiserror 2.0.21", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5844,7 +5844,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" dependencies = [ "memoffset", "tempfile", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -6267,7 +6267,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -6302,7 +6302,7 @@ dependencies = [ "objc2-foundation", "objc2-quartz-core", "raw-window-handle", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "windows-version", ] @@ -6683,7 +6683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" dependencies = [ "cfg-if", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6136938..25ea995 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -50,7 +50,7 @@ redis = { version = "1.7", default-features = false, features = ["aio", "tokio-c # Apache Cassandra: native CQL protocol (v4/v5), TLS through rustls. scylla = { version = "1.9", default-features = false, features = ["rustls-023"] } # SQLite: embedded engine compiled into the app. -rusqlite = { version = "0.40", features = ["bundled", "column_decltype", "column_metadata"] } +rusqlite = { version = "0.41", features = ["bundled", "column_decltype", "column_metadata"] } keyring = { version = "=3.6.3", features = ["apple-native", "windows-native", "sync-secret-service"] } # DBeaver import: credentials-config.json is AES-128-CBC. aes = "0.9" diff --git a/src-tauri/src/drivers/sqlite.rs b/src-tauri/src/drivers/sqlite.rs index 2899062..bf4a9a1 100644 --- a/src-tauri/src/drivers/sqlite.rs +++ b/src-tauri/src/drivers/sqlite.rs @@ -259,7 +259,6 @@ impl LiteSession { } let info = stmt .columns() - .iter() .map(|c| { let decl = c .decl_type() @@ -422,7 +421,6 @@ fn statement( let declared: Vec<(String, Option)> = stmt .columns() - .iter() .map(|c| { ( c.name().to_string(), @@ -654,7 +652,6 @@ fn column_origins(stmt: &Statement<'_>) -> Option Date: Fri, 13 Nov 2026 10:00:44 -0300 Subject: [PATCH 2/3] fix(updates): check every minute, with timeouts A new release took up to 10 minutes to show up, and a check that hung (after sleep or a network change) had no timeout, so every later check waited on it until the app restarted. Each check also left its Update resource open on the Rust side. The app now checks every minute, like Zynko, and again when the window gains focus or becomes visible (at most once per 15 seconds). Checks time out after 30 seconds and the background download after 15 minutes; updates that are not kept are closed. A version already found is not downloaded again every minute after a failed background download: installing from the dialog downloads it. A manual check during the background download opens the dialog instead of doing nothing. --- CHANGELOG.md | 3 ++ README.md | 2 +- src/lib/state/updates.svelte.ts | 61 +++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f9f8d2..31d7d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to LowQuery are documented here. The format follows [Keep a ## [Unreleased] +### Fixed +- **New versions show up within a minute.** The app checks every minute instead of every 10, and again when the window comes back from the tray. A check that hung (after sleep or a network change) no longer blocks the later ones, a failed background download is not repeated every minute, and checks no longer keep their discarded results in memory. + ## [0.5.5] - 2026-11-11 ### Fixed diff --git a/README.md b/README.md index c884d40..1f5dc03 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ The [latest release](https://github.com/LowBloat/LowQuery/releases/latest) inclu gh attestation verify LowQuery--linux-x64.AppImage --repo LowBloat/LowQuery ``` -**Updates.** Installed copies on Windows, macOS, AppImage, `.deb` and `.rpm` update themselves: LowQuery checks for a new release every few minutes and when the window regains focus, downloads it in the background and offers **Restart to update** once it is ready. Updates are signed and verified before installation. `.deb` and `.rpm` installs ask for the administrator password, since dpkg or rpm installs the new package. The Arch package and portable copies are told when a new version is out and link to the download. +**Updates.** Installed copies on Windows, macOS, AppImage, `.deb` and `.rpm` update themselves: LowQuery checks for a new release every minute and when the window comes back, downloads it in the background and offers **Restart to update** once it is ready. Updates are signed and verified before installation. `.deb` and `.rpm` installs ask for the administrator password, since dpkg or rpm installs the new package. The Arch package and portable copies are told when a new version is out and link to the download. **First launch on Windows and macOS.** The installers are not code-signed yet, so the system warns on first launch: diff --git a/src/lib/state/updates.svelte.ts b/src/lib/state/updates.svelte.ts index 179b660..81528e5 100644 --- a/src/lib/state/updates.svelte.ts +++ b/src/lib/state/updates.svelte.ts @@ -13,9 +13,23 @@ export interface UpdatePolicy { const RELEASES_URL = "https://github.com/LowBloat/LowQuery/releases/latest"; const FIRST_CHECK_MS = 5_000; -const CHECK_EVERY_MS = 10 * 60 * 1000; +/** The manifest is a small file on GitHub; checking every minute means a new + * release reaches open windows within a minute of being published. */ +const CHECK_EVERY_MS = 60 * 1000; /** Focus comes and goes quickly; at most one extra check per this long. */ -const FOCUS_GAP_MS = 2 * 60 * 1000; +const FOCUS_GAP_MS = 15 * 1000; +/** A check that hangs (a network that changed under it, a sleeping laptop) + * would otherwise keep every later check waiting. */ +const CHECK_TIMEOUT_MS = 30 * 1000; +/** The same for a stalled background download; installing from the dialog + * downloads again without a limit. */ +const DOWNLOAD_TIMEOUT_MS = 15 * 60 * 1000; + +/** Each check holds the update (and its download) on the Rust side until + * closed; checks run every minute, so the ones not kept are released. */ +function discard(update: Update | null) { + update?.close().catch(() => {}); +} /** Why an installation cannot update itself, shown next to the download link. */ const MANUAL_HINT: Record = { @@ -26,7 +40,7 @@ const MANUAL_HINT: Record = { /** * Automatic updates from GitHub Releases. The app checks shortly after it - * opens, every few minutes and whenever the window regains focus. A copy that + * opens, every minute and whenever the window comes back. A copy that * can update itself (Windows installer, macOS app, writable AppImage, .deb or * .rpm) downloads the signed update in the background; once it is verified and * ready, the sidebar offers "restart to update", which installs it right away. @@ -73,14 +87,23 @@ class Updates { getVersion().then((v) => (this.currentVersion = v)).catch(() => {}); setTimeout(() => this.check(false), FIRST_CHECK_MS); this.timer = setInterval(() => this.check(false), CHECK_EVERY_MS); - window.addEventListener("focus", () => { + const checkSoon = () => { if (Date.now() - this.lastCheck > FOCUS_GAP_MS) void this.check(false); + }; + window.addEventListener("focus", checkSoon); + // The window can come back from the tray or another desktop without focus. + document.addEventListener("visibilitychange", () => { + if (document.visibilityState === "visible") checkSoon(); }); } /** `interactive`: the user asked, so report "up to date" and errors. */ async check(interactive: boolean): Promise { - if (this.checking || this.downloading || this.installing) return; + if (this.checking || this.downloading || this.installing) { + // Still downloading what was found: show it rather than nothing. + if (interactive && this.available) this.dialogOpen = true; + return; + } this.checking = true; this.lastCheck = Date.now(); if (interactive) this.error = null; @@ -89,18 +112,23 @@ class Updates { // Copies that cannot install still read the AppImage entry to learn // the version and notes. const target = this.policy.target ?? (this.policy.canInstall ? undefined : "linux-x86_64-appimage"); - const update = await check(target ? { target } : undefined); + const update = await check({ timeout: CHECK_TIMEOUT_MS, ...(target ? { target } : {}) }); if (!update) { + discard(this.update); this.update = null; this.available = null; this.ready = false; return; } - // Already downloaded this one: nothing to do until the restart. - if (this.ready && this.available?.version === update.version) { + // Already found this one: nothing to do until the restart. A background + // download that failed is not repeated every minute; installing from + // the dialog downloads it again. + if (this.update && this.available?.version === update.version) { + discard(update); if (interactive) this.dialogOpen = true; return; } + discard(this.update); this.update = update; this.ready = false; this.available = { version: update.version, notes: update.body ?? "" }; @@ -120,13 +148,16 @@ class Updates { let total = 0; let received = 0; try { - await update.download((event) => { - if (event.event === "Started") total = event.data.contentLength ?? 0; - else if (event.event === "Progress") { - received += event.data.chunkLength; - this.progress = total > 0 ? Math.min(1, received / total) : null; - } - }); + await update.download( + (event) => { + if (event.event === "Started") total = event.data.contentLength ?? 0; + else if (event.event === "Progress") { + received += event.data.chunkLength; + this.progress = total > 0 ? Math.min(1, received / total) : null; + } + }, + { timeout: DOWNLOAD_TIMEOUT_MS }, + ); if (this.update === update) this.ready = true; } catch { // The dialog falls back to download-and-install in one go. From 524ef73f9ced6817f6c2f92fc96c367068bf24b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henrique=20Ara=C3=BAjo?= Date: Fri, 13 Nov 2026 10:20:25 -0300 Subject: [PATCH 3/3] chore: release 0.5.6 --- CHANGELOG.md | 8 +++++++- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d7d99..f023ad5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,14 @@ All notable changes to LowQuery are documented here. The format follows [Keep a ## [Unreleased] +## [0.5.6] - 2026-11-13 + ### Fixed - **New versions show up within a minute.** The app checks every minute instead of every 10, and again when the window comes back from the tray. A check that hung (after sleep or a network change) no longer blocks the later ones, a failed background download is not repeated every minute, and checks no longer keep their discarded results in memory. +### Security +- SQLite 3.54.1, bundled through `rusqlite` 0.41.1: opening a database together with a crafted `-wal` file no longer returns uninitialized page-cache memory (RUSTSEC-2026-0459). + ## [0.5.5] - 2026-11-11 ### Fixed @@ -182,7 +187,8 @@ First public release, with PostgreSQL and Oracle. - Schema browser for tables, views, sequences, routines, packages and columns. - Drafts restored on restart, light and dark themes, and a layout for narrow windows. -[Unreleased]: https://github.com/LowBloat/LowQuery/compare/v0.5.5...HEAD +[Unreleased]: https://github.com/LowBloat/LowQuery/compare/v0.5.6...HEAD +[0.5.6]: https://github.com/LowBloat/LowQuery/compare/v0.5.5...v0.5.6 [0.5.5]: https://github.com/LowBloat/LowQuery/compare/v0.5.4...v0.5.5 [0.5.4]: https://github.com/LowBloat/LowQuery/compare/v0.5.3...v0.5.4 [0.5.3]: https://github.com/LowBloat/LowQuery/compare/v0.5.2...v0.5.3 diff --git a/package.json b/package.json index eccf5a2..e18cbc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lowquery", - "version": "0.5.5", + "version": "0.5.6", "description": "LowQuery: a lightweight multi-database SQL client (Oracle and PostgreSQL).", "homepage": "https://github.com/LowBloat/LowQuery", "repository": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index bb8fca2..a741557 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2663,7 +2663,7 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "lowquery" -version = "0.5.5" +version = "0.5.6" dependencies = [ "aes", "cbc", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 25ea995..4b00dff 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lowquery" -version = "0.5.5" +version = "0.5.6" description = "Lightweight SQL client for multiple databases" authors = ["LowBloat"] license = "AGPL-3.0-only" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index c6db27e..528ab92 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "LowQuery", - "version": "0.5.5", + "version": "0.5.6", "identifier": "dev.lowbloat.lowquery", "build": { "beforeDevCommand": "bun run dev",