Skip to content

deps: rusqlite 0.41 for RUSTSEC-2026-0459 (libsqlite3-sys) - #14709

Merged
TheHypnoo merged 3 commits into
PerryTS:mainfrom
raliclo:fix/rusqlite-rustsec-2026-0459
Nov 16, 2026
Merged

TheHypnoo merged 3 commits into
PerryTS:mainfrom
raliclo:fix/rusqlite-rustsec-2026-0459

Conversation

@raliclo

@raliclo raliclo commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

main's security-audit job fails cargo audit on RUSTSEC-2026-0459 (CVE-2026-119375, GHSA-72w2-rjgg-q729, CVSS 6.8): SQLite before 3.54.0 can return uninitialized page-cache memory when a database is opened together with a sibling -wal file whose page size differs from the database's. libsqlite3-sys 0.6.0–0.38.2 bundle SQLite ≤ 3.53.2 and are affected; patched is libsqlite3-sys >= 0.39.0 (SQLite 3.54.0 / 3.54.1), released with rusqlite 0.41.

Affected path: libsqlite3-sys 0.37.0 ← rusqlite 0.39.0 (bundled) ← perry-stdlib (feature database-sqlite) and perry-ext-better-sqlite3.

This bumps both manifests to rusqlite = "0.41" (resolves to 0.41.1 / libsqlite3-sys 0.39.1, SQLite 3.54.1). 0.41 is the minimal fixing line (0.40.x still bundles 3.53.x). Both versions are past the 7-day global-min-publish-age soak (0.41.1: 2026-10-28; libsqlite3-sys 0.39.1: 2026-10-25); 0.42 (2026-11-11) is not.

Changes

  • crates/perry-stdlib/Cargo.toml, crates/perry-ext-better-sqlite3/Cargo.toml: rusqlite 0.39 → 0.41. Feature sets unchanged (bundled, column_decltype, limits, session / bundled, column_decltype, column_metadata).
  • API adaptation (rusqlite 0.41, #1877): Statement::column_names(), columns() and columns_with_metadata() return iterators instead of Vecs.
    • perry-ext-better-sqlite3/src/lib.rs: drop three .iter() calls (were compile errors).
    • perry-stdlib/src/sqlite/better.rs, better_tests.rs, perry-ext-better-sqlite3/src/tests.rs: drop four .into_iter() calls (new clippy::useless_conversion warnings otherwise); rustfmt then joins two of those chains onto one line.
  • Other 0.40/0.41 changelog items reviewed: the PRAGMA-name check only applies to pragma_* helpers (Perry issues PRAGMAs as SQL / raw FFI); the Send bound on create_aggregate_function/create_window_function doesn't apply (Perry uses ffi::sqlite3_create_window_function directly); no use of zeroblob, trace_v2, busy_handler or rusqlite's serialize. MSRV 1.89 vs toolchain nightly-2026-10-04 (1.101). License unchanged (MIT).
  • changelog.d/14709-rusqlite-advisory.md.

Cargo.lock delta

crate before after why
rusqlite 0.39.0 0.41.1 the bump
libsqlite3-sys 0.37.0 0.39.1 the fix
hashlink 0.11.1 0.12.2 rusqlite dep (now on hashbrown 0.17.1, already in the lock)
bindgen 0.72.1 0.73.2 libsqlite3-sys build-dep (its only consumer; now on syn 3.0.3, already in the lock)
itertools 0.13.0, shlex 1.3.0 removed — were only used by bindgen 0.72

No package is new to the lock (970 crates, was 972).

Test plan

All run on macOS arm64 with CARGO_BUILD_JOBS=3, Node 26.12.1, first on pristine main (fee15e5) and then on this branch; the branch was then rebased onto dc9dd6b (no Cargo/sqlite changes upstream in between) and the audit/deny/tokio checks re-run.

check main this branch
cargo audit --ignore RUSTSEC-2023-0071 (the CI command) 1 vulnerability (RUSTSEC-2026-0459), 8 allowed warnings 0 vulnerabilities, same 8 allowed warnings
cargo deny check licenses bans sources ok ok
python3 scripts/tokio_inventory.py --offline clean (115 manifests, 27 lockfiles) clean (115 manifests, 27 lockfiles)
cargo test -p perry-ext-better-sqlite3 -- --test-threads=1 18 passed 18 passed
cargo test -p perry-stdlib --features database-sqlite --lib sqlite -- --test-threads=1 16 passed, 1 failed (sqlite::bind::tests::typed_arrays_are_not_named_parameter_objects, panic in perry-runtime/src/family_never.rs:99) identical
scripts/parity.py run node-suite/sqlite --mode fast 56 pass / 4 parity_fail identical (same 4 cases, same output)
scripts/parity.py run npm/better-sqlite3 --mode fast 9 pass / 1 parity_fail identical (same case)
scripts/parity.py run perry/sqlite --mode fast 3 pass 3 pass
cargo build-perry --release + sidecars ok ok
cargo clippy -p perry-ext-better-sqlite3 -p perry-stdlib --features perry-stdlib/database-sqlite --tests (warnings in those two crates) 463 463, identical set
rustfmt --check --edition 2021 on changed .rs — clean
SKIP_COMPILE_GATES=1 scripts/run_lint_gates.sh FAIL set 20 identical 20 (all pre-existing)

The pre-existing failures above are unrelated to this change (see #14699 for the main-red inventory).

  • cargo audit (security-audit command) passes; cargo deny and the Tokio inventory unchanged
  • sqlite crates' unit tests and the sqlite parity subjects give the same results as main
  • Cargo.lock delta limited to rusqlite / libsqlite3-sys and their necessary transitive bumps

🤖 Generated with Claude Code

https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p

Summary by CodeRabbit

  • Bug Fixes
    • Updated the SQLite libraries and bundled SQLite release used by the integrations.
    • Improved compatibility for retrieving column names and types with the updated libraries. Existing SQLite interfaces retain their reported behavior.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2a64b74-aaa1-495f-a8bb-e4a6a7f88926
Commits

Reviewing files that changed from the base of the PR and between 84a8b1c and 5de0cea.

Files ignored due to path filters: 1

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

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

No actionable comments were generated in the recent review.

Walkthrough

The rusqlite dependency is upgraded from 0.39 to 0.41 in two crates. SQLite column-name and column-type call sites and related tests are adjusted for the iterator APIs. The parity snapshot removes one failure entry.

Changes: SQLite rusqlite upgrade

Layer / File(s) Summary
Upgrade rusqlite
crates/perry-ext-better-sqlite3/Cargo.toml, crates/perry-stdlib/Cargo.toml, changelog.d/14709-rusqlite-advisory.md
Both manifests update rusqlite to 0.41 and retain their configured features. The changelog records the upgrade, advisory, audit job, iterator API adjustments, and stated lack of behavior changes in three SQLite integrations.
Adjust column iterator call sites
crates/perry-ext-better-sqlite3/src/lib.rs, crates/perry-ext-better-sqlite3/src/tests.rs, crates/perry-stdlib/src/sqlite/better.rs, crates/perry-stdlib/src/sqlite/better_tests.rs, tests/parity/snapshots/linux-auto/node-suite/sqlite.json
SQLite code and tests remove iterator conversions from column-name paths. The extension reads declared column types directly from prepared.columns(). The parity snapshot removes the test_gap_native_payload_cb-sqlite failure entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: thehypnoo

Merge Risk: Minimal · previous review 84a8b

This upgrades the SQLite dependency to resolve a security advisory, and the code changes are small call-site adjustments. Reported test and audit results show no new regressions relative to main, so merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: upgrading the rusqlite dependency to 0.41 to resolve RUSTSEC-2026-0459 in libsqlite3-sys. The changeset matches this: Cargo manifests move from rusqlite 0.39 to 0.41, …
Description check Passed The description follows the repository template. It has a Summary, a Changes list with file paths, a Test plan with the required checkboxes, and a Related issue reference to the advisory. It does not …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: upgrading the rusqlite dependency to 0.41 to resolve RUSTSEC-2026-0459 in libsqlite3-sys. The changeset matches this: Cargo manifests move from rusqlite 0.39 to 0.41, and the Rust call sites are adapted to the iterator-returning column APIs.

Full details: Description check

Explanation

The description follows the repository template. It has a Summary, a Changes list with file paths, a Test plan with the required checkboxes, and a Related issue reference to the advisory. It does not state a related issue number. It also gives no Screenshots section, which is optional. It does not show whether the template's workspace-version and CHANGELOG.md checklist items were verified. The changelog entry added under changelog.d/ is not an edit to CHANGELOG.md, so it does not conflict with the template. The test plan is detailed and gives command output for the checks.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ffeff6f7-98fa-4de5-9820-9a2ebf3af5a8
Commits

Reviewing files that changed from the base of the PR and between c707b56 and 84a8b1c.

Files selected for processing: 1

  • tests/parity/snapshots/linux-auto/node-suite/sqlite.json
Files with no reviewable changes: 1

  • tests/parity/snapshots/linux-auto/node-suite/sqlite.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

raliclo pushed a commit to raliclo/perry that referenced this pull request Nov 15, 2026
parity-scoped on this PR (run 43617261678) reports
node-suite/sqlite/test_gap_native_payload_cb-sqlite as passing on
linux-auto, where the snapshot still lists it as parity_fail; the gate
fails on a listed case that starts passing. The macos-auto snapshot
already has it passing.

Accepted from that run's parity-scoped-report artifact with
`python3 scripts/parity.py accept latest.json` (platform linux, mode
auto, taken from the report), not hand-edited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
@raliclo

raliclo commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 84a8b1c: re-baselines tests/parity/snapshots/linux-auto/node-suite/sqlite.json.

parity-scoped was red only because node-suite/sqlite/test_gap_native_payload_cb-sqlite now passes (IMPROVEMENT: parity_fail -> pass), and the snapshot is checked both ways. I applied the change with python3 scripts/parity.py accept on this PR's own parity-scoped-report artifact (run 43617261678, linux/auto: 60 cases, 56 pass). It removes only that entry; the other 4 failures stay listed. A second accept changes nothing.

The cargo-test red here, sqlite::bind::tests::typed_arrays_are_not_named_parameter_objects panicking at family_never.rs:99, also fails on main 64257c3, the same panic when I run it locally.

ralic and others added 3 commits November 16, 2026 14:25
libsqlite3-sys 0.37.0 (via rusqlite 0.39) bundles SQLite 3.53.x, which
can return uninitialized page-cache memory when a database is opened
with a sibling -wal file of a different page size (CVE-2026-119375).
rusqlite 0.41 pulls libsqlite3-sys 0.39 (SQLite 3.54.x), which is
patched; this clears the security-audit job's cargo audit failure.

rusqlite 0.41 makes Statement::column_names / columns /
columns_with_metadata return iterators instead of Vecs, so drop the
.iter() / .into_iter() calls at their call sites. Feature flags are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
parity-scoped on this PR (run 43617261678) reports
node-suite/sqlite/test_gap_native_payload_cb-sqlite as passing on
linux-auto, where the snapshot still lists it as parity_fail; the gate
fails on a listed case that starts passing. The macos-auto snapshot
already has it passing.

Accepted from that run's parity-scoped-report artifact with
`python3 scripts/parity.py accept latest.json` (platform linux, mode
auto, taken from the report), not hand-edited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
@TheHypnoo
TheHypnoo force-pushed the fix/rusqlite-rustsec-2026-0459 branch from 84a8b1c to 5de0cea Compare November 16, 2026 13:26
@TheHypnoo
TheHypnoo merged commit 4d9bca4 into PerryTS:main Nov 16, 2026
114 of 134 checks passed
@raliclo
raliclo deleted the fix/rusqlite-rustsec-2026-0459 branch November 17, 2026 01:36
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.

3 participants