Repository navigation
fix(rosetta): update rusqlite to 0.42 and tokio-rusqlite to 0.9 (RUSTSEC-2026-0459) - #12194
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the SQLite dependency update addressing RUSTSEC-2026-0459.
No open issues 🎉
What changed in this PR
Updates Rosetta’s SQLite dependencies in Cargo and Bazel to address RUSTSEC-2026-0459 while preserving unsigned-value conversions and index-creation error handling.
Changes:
- Upgrades rusqlite to 0.42, tokio-rusqlite to 0.9, and bundled libsqlite3-sys to 0.40.
- Enables
fallible_uintand handles the fallible progress-handler API, preserving the index-creation error if cleanup also fails. - Refreshes lock files, removing hashlink 0.10 and adding wasm-only dependencies.
| File | Description |
|---|---|
rs/rosetta-api/icrc1/Cargo.toml |
Upgrades ICRC Rosetta’s tokio-rusqlite dependency. |
rs/rosetta-api/icp/ledger_canister_blocks_synchronizer/src/blocks.rs |
Propagates progress-handler registration and cleanup errors. |
Cargo.toml |
Upgrades workspace rusqlite and enables fallible_uint. |
Cargo.lock |
Records updated Cargo dependency versions and edges. |
Cargo.Bazel.toml.lock |
Records matching Bazel dependency resolution. |
Cargo.Bazel.json.lock |
Refreshes Bazel crate metadata, features, and platform-specific dependencies. |
bazel/rust.MODULE.bazel |
Aligns Bazel dependency versions and features with Cargo. |
Review effort: Balanced
rzakrzyk
approved these changes
Nov 19, 2026
|
✅ No security or compliance issues detected. Reviewed everything up to 4417f84. Security OverviewDetected Code Changes
|
mbjorkqvist
approved these changes
Nov 19, 2026
…SEC-2026-0459) libsqlite3-sys 0.35.0 bundles SQLite 3.50.2, which can return uninitialized page-cache memory for a database whose -wal file has a different page size (CVE-2026-119375). rusqlite 0.42 uses libsqlite3-sys 0.40.0, which bundles SQLite 3.54.1. tokio-rusqlite 0.9 requires rusqlite 0.42. rusqlite 0.38 and later implement ToSql and FromSql for u64 and usize only with the fallible_uint feature, with the same code as before, so enable it. Connection::progress_handler now returns a Result; propagate it, and keep returning the CREATE INDEX error first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
basvandijk
force-pushed
the
bas/bump-rusqlite-0.42
branch
from
November 19, 2026 18:05
5a31da6 to
4417f84
Compare
cameronraysmith
pushed a commit
to cameronraysmith/ic
that referenced
this pull request
Nov 20, 2026
…e (RUSTSEC-2026-0258) (dfinity#12193) Removes h2 0.3.27 from both lock files by turning off actix-web's `http2` feature. The daily RustSec job (`.github/workflows/rust-advisories.yml`, e.g. [run 44535761188](https://github.com/dfinity/ic/actions/runs/44535761188)) reports h2 0.3.27 with RUSTSEC-2026-0258: - h2 accepts and queues empty DATA frames without limit. - If a stream is not drained, the peer can make memory grow without bound, or cause a panic once the length overflows. - The advisory rates it low severity. **Why h2 0.3 can't be updated:** - h2 0.3 has no fixed release; the 0.4 line is fixed from 0.4.16. A 0.3 backport (hyperium/h2#948) was closed unmerged. - Our other h2 users (hyper, tonic, reqwest, hickory-net) are on 0.4.20. - h2 0.3 comes only from actix-http's optional `http2` feature, and actix-http has no release on h2 0.4. actix/actix-web#4199 asks for one, and moving to h2 0.4 also means moving actix-http from http 0.2 to http 1. **Who uses actix-web:** - ICP Rosetta uses it directly. - rosetta-core, which ICRC Rosetta also uses, pulls it in through actix-web-prom, which enables only actix-web's `macros` feature. - Only ICP Rosetta runs an actix-web server. ICRC Rosetta serves with axum. # Behaviour change: ICP Rosetta serves HTTP/1.x only - ICP Rosetta's server listens on plain TCP (`HttpServer::bind`), without TLS. - Since actix-web 4.19, a plaintext listener also accepts cleartext HTTP/2 (h2c) by default when the `http2` feature is on. - dfinity#12177 moved actix-web from 4.13 (Cargo) and 4.9 (Bazel) to 4.20. So ICP Rosetta built from master since then accepts h2c, and with it reaches h2 0.3. - Without the feature it accepts HTTP/1.x only, as every released ICP Rosetta did. A client that starts with the HTTP/2 preface now gets a 400 from the HTTP/1 parser. - The last release, 2.1.10 (2026-07-01), predates dfinity#12177, and Rosetta images are only published by the manual Rosetta Release workflow. So no published image ever accepted h2c, and the CHANGELOG needs no entry. - Released images do link h2 0.3.27, but can't reach it. Image scanners will keep flagging it until the next ICP Rosetta release. - No client in the repo talks to ICP Rosetta over HTTP/2. Its clients use plain reqwest over `http://`, which speaks HTTP/1.1. FYI @dfinity/defi, who own `rs/rosetta-api`. # Changes - `Cargo.toml` and `bazel/rust.MODULE.bazel`: remove `http2` from actix-web's features. - **Locks:** - In both lock sets only h2 0.3.27 goes, and the only dependency edge removed is actix-http's edge to it. - hyper, tonic, reqwest and hickory-net now list plain `h2` instead of `h2 0.4.20`, since only one h2 is left. # Verification - **Advisories:** I ran the workflow's pinned tools on this branch, cargo-deny 0.21.0 on `Cargo.lock` and cargo-audit 0.23.0 on `Cargo.Bazel.toml.lock`. Neither reports RUSTSEC-2026-0258 any more; three vulnerabilities remain: - libsqlite3-sys, fixed in dfinity#12194; - rsa 0.9 and crypto-bigint 0.5, which need upstream releases first. - **Locks:** in the dev container, `cargo update --workspace` reports "Locking 0 packages". A second `./bin/bazel-pin.sh` reports "Nothing to repin.", and `bazel mod deps` leaves `MODULE.bazel.lock` unchanged. - **Build:** `cargo check --all-targets --all-features -p ic-rosetta-api -p rosetta-core` passes, and the ICP Rosetta binaries build with Bazel. The Bazel-built binaries contain no h2 0.3 code. - **Tests:** these pass locally. They exercise HTTP/1.1; nothing tests that h2c is refused. - `//rs/rosetta-api/common/rosetta_core:rosetta_core_unit_tests`; - `//rs/rosetta-api/icp:rosetta-api_test`; - `//rs/rosetta-api/icp:icp_rosetta_system_tests`, which serves the Rosetta API over HTTP; - `//rs/rosetta-api/icp/tests/integration_tests:rosetta-integration_tests/tests_test`. - **Lint:** CI's Cargo Lint job, which runs `./ci/scripts/rust-lint.sh`, passes. - **CI:** before this PR was stacked on dfinity#12191, CI ran every Bazel target, long tests included, on 419d088 (the same change on top of 375a6af). All 1,163 tests pass, including `icp_rosetta_system_tests` and the `rosetta_test_local` and `rosetta_neuron_follow_test_local` system tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
q-uint
pushed a commit
to Swiss-Subnet/ic
that referenced
this pull request
Nov 26, 2026
…finity#12232) Updates rusqlite from 0.42.0 to 0.43.0 and tokio-rusqlite from 0.9.0 to 0.10.0 in both the Cargo and the Bazel build, so Rosetta, their only user, stays on the latest releases. This follows up on dfinity#12194, which stopped at rusqlite 0.42 because no tokio-rusqlite release accepted 0.43 before 0.10.0. # Changes - `Cargo.toml`: rusqlite `0.42.0` → `0.43.0` ([release notes](https://github.com/rusqlite/rusqlite/releases/tag/v0.43.0)). - `bazel/rust.MODULE.bazel`: rusqlite `^0.42.0` → `^0.43.0` and tokio-rusqlite `^0.9` → `^0.10`. - `rs/rosetta-api/icrc1/Cargo.toml`: tokio-rusqlite `0.9` → `0.10`. tokio-rusqlite 0.10.0 only raises its rusqlite requirement to `^0.43.0`; its code is the same as in 0.9.0. - `Cargo.lock`, `Cargo.Bazel.toml.lock` and `Cargo.Bazel.json.lock`: only rusqlite and tokio-rusqlite move. # Behaviour changes - **Rebuilt with rusqlite 0.43.0:** - ICP Rosetta: `//rs/rosetta-api/icp:ic-rosetta-api`, `:ic-rosetta-api-rosetta-blocks` and the image `:rosetta_image`; - ICRC Rosetta: `//rs/rosetta-api/icrc1:ic-icrc-rosetta-bin` and the image `:ic_icrc_rosetta_image`; - the ICRC Rosetta client `//rs/rosetta-api/icrc1/client:ic-icrc-rosetta-client-bin`; - the system-test binaries, whose driver links `ic-rosetta-api`. The bundled SQLite stays 3.54.1, because libsqlite3-sys stays at 0.40.0. - **Empty SQL** (rusqlite/rusqlite#1956): `prepare`, `prepare_cached`, `execute`, `query_row` and `query_one` now return the new `Error::Empty` ("SQL is empty or comment only") for SQL that holds only whitespace, `;` or comments. In 0.42, `prepare` returned a statement that failed with `SQLITE_MISUSE` when stepped. Rosetta passes no such SQL. On master 87617d5, in the Rosetta files that use rusqlite, every SQL argument to these calls is either a non-empty statement or starts with fixed `SELECT`, `INSERT`, `DELETE` or `CREATE INDEX` text. FYI @dfinity/defi, who own `rs/rosetta-api`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates rusqlite from 0.37 to 0.42 and tokio-rusqlite from 0.7 to 0.9 in both builds. This moves libsqlite3-sys from 0.35.0 to 0.40.0, which fixes RUSTSEC-2026-0459. The daily RustSec job (
.github/workflows/rust-advisories.yml, e.g. run 44535761188) reports that advisory for both lock files.The advisory (CVE-2026-119375, medium):
-walfile whose page size differs.journal_mode, so Rosetta's own databases use the rollback journal and never have a-walfile. In practice this PR mainly clears the scanner finding.Versions:
column_metadata).Who opens SQLite databases: only Rosetta:
ledger_canister_blocks_synchronizer;The system-test driver links ICP Rosetta's library, so system tests build the new SQLite too, but the driver opens no databases. FYI @dfinity/defi, who own
rs/rosetta-api.Code changes
u64andusizecolumns: rusqlite 0.38 and later implementToSqlandFromSqlforu64andusizeonly with the newfallible_uintfeature.crate.specnow enable it.i64::MAXfails, and so does reading a negative one.progress_handler:Connection::progress_handlernow returns aResult, because it registers the handler throughsqlite3_set_clientdata.create_index_if_not_existsinledger_canister_blocks_synchronizerpropagates it.CREATE INDEXstatement and clearing the handler fail, it still returns theCREATE INDEXerror.Behaviour changes
SQLITE_ENABLE_MEMORY_MANAGEMENT(Don't enable SQLITE_ENABLE_MEMORY_MANAGEMENT in the bundled build rusqlite/rusqlite#1900, in rusqlite 0.41).cache_size. Before, connections shared one cache, and a busy connection could take pages from idle ones.sqlite3_release_memory()now does nothing.--flush-cache-shrink-mem(cache_flush()plusPRAGMA shrink_memory) and--sqlite-max-cache-kb(PRAGMA cache_size) work per connection, so they behave as before. No test turns them on.crate.annotationon libsqlite3-sys withbuild_script_env = {"LIBSQLITE3_FLAGS": "-DSQLITE_ENABLE_MEMORY_MANAGEMENT"}would restore the old behaviour.prepare_cacheduses moved behind the defaultcachefeature, which both builds keep.extra_check, which is off.Lock changes
hashlink 0.12.2entry only loses its version suffix, since that is now the only hashlink.Verification
Cargo.lockand cargo-audit 0.23.0 onCargo.Bazel.toml.lock. Neither reports RUSTSEC-2026-0459 any more; three vulnerabilities remain:cargo update --workspacereports "Locking 0 packages". A second./bin/bazel-pin.shreports "Nothing to repin.", andbazel mod depsleavesMODULE.bazel.lockunchanged../ci/scripts/rust-lint.shpasses. It compiles every Rosetta crate with--all-targets --all-featuresand--deny warnings.blocks.rsbuild.//rs/rosetta-api/icp/ledger_canister_blocks_synchronizer:ledger_canister_blocks_synchronizer_test;//rs/rosetta-api/icp/ledger_canister_blocks_synchronizer:ledger_canister_blocks_synchronizer_test_suite_tests/store_tests_test;//rs/rosetta-api/icp:rosetta-api_test;//rs/rosetta-api/icp:icp_rosetta_system_tests;//rs/rosetta-api/icp/tests/integration_tests:rosetta-integration_tests/tests_test;//rs/rosetta-api/icrc1:ic-icrc-rosetta-unit-tests;//rs/rosetta-api/icrc1:icrc_rosetta_integration_tests/integration_tests.rosetta-cli(rosetta-api-cli-tests,icrc_rosetta_system_tests,icrc_multitoken_rosetta_system_tests) and therosetta_test_localandrosetta_neuron_follow_test_localsystem tests.🤖 Generated with Claude Code