Skip to content

Replace tiberius with mssql (maintained fork with security fixes) - #448

Open
joelparkerhenderson wants to merge 1 commit into
rust-db:mainfrom
joelparkerhenderson:migrate-tiberius-to-mssql
Open

Replace tiberius with mssql (maintained fork with security fixes)#448
joelparkerhenderson wants to merge 1 commit into
rust-db:mainfrom
joelparkerhenderson:migrate-tiberius-to-mssql

Conversation

@joelparkerhenderson

@joelparkerhenderson joelparkerhenderson commented Sep 1, 2026

Copy link
Copy Markdown

Fixes #447

Problem

Refinery depends on the Rust crate tiberius which has security problems and maintenance problems. Specifics below.

Solution

There are two recent forks of the crate that provide the security updates and PRs.

Either fork is fine IMHO. You'll want to test them because they're both quite new. I prefer the name mssql because I work with Microsoft extensively and I'm working with their security teams; Matt prefers the tiberius-ng name because it's more similar to the original.

This PR implements the mssql direction as one concrete option — happy to redo it against tiberius-ng instead, or split it differently, if maintainers prefer.

Code change

Breaking change: renames the tiberius/tiberius-config Cargo features to mssql/mssql-config,
and the public re-export refinery_core::tiberius becomes refinery_core::mssql. Anyone matching on
tiberius::error::Error or importing refinery_core::tiberius::* directly will need to update.
refinery is pre-1.0 (0.9.2), so this can ship as a minor version bump under Cargo's semver rules.

13 files, mechanical rename (no logic changes beyond the type/feature names) — see the diff for
the full change. Verified against the published mssql 1.0.1 crate:

cargo check -p refinery-core --no-default-features --features mssql-config
cargo check -p refinery-core --no-default-features --features mssql
cargo check -p refinery       --no-default-features --features mssql-config,toml
cargo check -p refinery --tests --no-default-features --features mssql-config,toml
cargo check -p refinery_cli   --no-default-features --features mssql

All pass.

Security specifics

  1. Three unpatched RUSTSEC advisories — RUSTSEC 2026-0098, 2026-0099, 2026-0104
  2. Unnmerged fixes: prisma/tiberius#419
    fixes this yet has been open since 2026-05-12 with no maintainer response.
  3. Reachable panics from untrusted server input: #424 and #425 document 11 sites in the TDS decoder where a malformed/malicious server response aborts the client process rather than returning Err. Tracked by the RustSec working group at advisory-db#3148.
  4. Maintenance appears stalled: no commits since 2026-03-06, 140 open issues, and a maintainer-handover request (#427) went unanswered for 11 days.

Drafted with Claude Code; I reviewed and take responsibility for the change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HmakCYmBF3qUgiW7ctoFJm

tiberius currently has three unpatched RUSTSEC advisories (RUSTSEC-2026-0098,
-0099, -0104) in its rustls-webpki dependency, a fix PR (tiberius-rs/tiberius#419)
open since 2026-05-12 with no maintainer response, 11 reachable panic sites
from untrusted server input (tiberius-rs/tiberius#424, rust-db#425), and a maintainer
handover request (tiberius-rs/tiberius#427) unanswered for 11+ days.

This renames the tiberius/tiberius-config Cargo features to mssql/mssql-config
and swaps the crate dependency to the mssql fork (https://crates.io/crates/mssql,
https://github.com/mssql-rust/mssql-rust), which carries the rustls 0.23
upgrade fixing the three advisories. Verified against the published mssql
1.0.1 crate:

  cargo check -p refinery-core --features mssql-config
  cargo check -p refinery-core --features mssql
  cargo check -p refinery --features mssql-config,toml
  cargo check -p refinery --tests --features mssql-config,toml
  cargo check -p refinery_cli --features mssql

BREAKING CHANGE: refinery_core::tiberius (public re-export) is now
refinery_core::mssql; the tiberius/tiberius-config feature flags are renamed
to mssql/mssql-config. refinery is pre-1.0 (0.9.2), so this can ship as a
minor version bump.

An equally-maintained alternative fork, tiberius-ng
(https://github.com/MattJackson/tiberius-ng), also fixes these issues and
keeps the tiberius name/API if maintainers prefer that direction instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmakCYmBF3qUgiW7ctoFJm
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.

Security bug: Rust crate tiberius is having problems; here are drop-in replacements.

1 participant