Skip to content

SECURITY: zellij links the system SQLite, not a bundled pre-3.54.0 copy (CVE-2026-119375) - #1463

Merged
bryan-minimal merged 2 commits into
mainfrom
zellij-system-sqlite
Nov 13, 2026
Merged

bryan-minimal merged 2 commits into
mainfrom
zellij-system-sqlite

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

SECURITY: CVE-2026-119375 (RUSTSEC-2026-0459, GHSA-72w2-rjgg-q729). SQLite before 3.54.0 can return uninitialized page-cache memory when it opens a database together with a -wal file whose page size differs. A crafted pair of files makes ordinary queries return stale bytes from the process. The attack is local, and the victim has to open the files.

zellij-utils enables rusqlite 0.30 with its bundled feature (switched on by web_server_capability, which our build enables). That compiles libsqlite3-sys 0.27.0's own pre-3.54.0 SQLite into the zellij we ship. Per the advisory, only the bundled build is affected. Our sqlite package is 3.54.1.

This PR:

  • build.sh drops bundled from zellij-utils' rusqlite line before compiling, so libsqlite3-sys links the system libsqlite3. It fails closed if bundled is still there or the line has changed shape, and after the compile it requires NEEDED libsqlite3.so (the same pattern as the existing libcurl check). It also deletes the one Cargo.lock line the feature change implies: without bundled, libsqlite3-sys no longer pulls its optional cc build-dependency, so "cc", leaves libsqlite3-sys's dependency list. cc itself stays, since 13 other crates use it. Without that edit, the --locked build refused to rewrite the lock (the first build-bot run failed this way on both arches). The edit is guarded both ways: the build fails if cc is still listed or if libsqlite3-sys is no longer 0.27.0.
  • build.ncl adds sqlite as a build dep and subsetOf sqlite ["libs"] as a runtime dep.

Tested off-host against v0.45.1's real zellij-utils/Cargo.toml: the substitution matches exactly once, rusqlite stays optional behind web_server_capability, and both guards pass. As a negative control, the unpatched file fails the bundled guard. CI's build is the first compile.

Rebuilds: 1 (zellij; mip dump --packages, amd64).

Why now: pkgmgr refused zellij 0.46.0 on 2026-11-12 (lock_patch_refused) because the libsqlite3-sys floor (0.39.0) needs rusqlite 0.41, an API break. This fixes the CVE on the version we ship, independently of the bump. The pkgmgr side, so that it stops demanding that floor for zellij and stops flagging test-only crates such as scc via serial_test, is separate work.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility
    • The application now links against the system SQLite library, which must be available at runtime.
  • Build Requirements
    • SQLite is now required when building the application.

…-119375)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 12, 2026 17:38
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Zellij build adds SQLite as a build and runtime dependency. Its build script removes rusqlite’s bundled SQLite configuration and checks the dependency declarations and binary linkage.

Changes: System SQLite linking

Layer / File(s) Summary
Declare system SQLite build dependencies
packages/zellij/build.ncl, packages/zellij/build.sh
The build definition adds SQLite build and runtime dependencies. The build script removes rusqlite’s bundled feature and the corresponding cc lockfile entry. It checks that these declarations are absent and that libsqlite3-sys remains at version 0.27.0.
Verify SQLite linkage
packages/zellij/build.sh
The build script now fails if the binary does not list libsqlite3.so. The existing libcurl.so check remains.

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

Suggested reviewers: msample, agent-137

Merge Risk: Minimal · up to c482a

This change makes zellij link the system SQLite instead of the bundled copy. The build fails if the expected edits are missing or the binary does not link libsqlite3.so, so no concrete merge-blocking risk is visible.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: zellij is switched to link the system SQLite instead of a bundled pre-3.54.0 copy, which the objectives and summaries confirm (bundled feature removed from rusqlite in…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: zellij is switched to link the system SQLite instead of a bundled pre-3.54.0 copy, which the objectives and summaries confirm (bundled feature removed from rusqlite in build.sh, sqlite added as a dependency in build.ncl). It also cites the CVE. The title is specific and on-topic. It is long (89 characters) and uses a 'SECURITY:' prefix, but these do not make it unclear or misleading.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1ab13ae and c482a89.

Files selected for processing: 2

  • packages/zellij/build.ncl
  • packages/zellij/build.sh

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Without rusqlite's bundled feature, libsqlite3-sys no longer pulls its
optional cc build-dependency, and the --locked build refused to rewrite
the lock (build-bot FTBFS on amd64 and arm64).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@agent-137 agent-137 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at c482a89c on Karl's behalf. zellij now builds against the system SQLite (3.54.1) instead of rusqlite's bundled pre-3.54.0 copy. The Cargo.lock edit drops only cc from libsqlite3-sys's dependency list, which is the change --locked refused on the first head. Both edits fail the build if they stop matching, and the existing readelf check requires a NEEDED libsqlite3.so. The minimal build is green on both arches.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 239ba4c Nov 13, 2026
15 checks passed
@bryan-minimal
bryan-minimal deleted the zellij-system-sqlite branch November 13, 2026 04:08
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.

2 participants