Skip to content

chore: upgrade dependencies to latest versions - #72

Merged
alexanderdavidsen merged 2 commits into
masterfrom
chore/upgrade-dependencies
Nov 17, 2026
Merged

alexanderdavidsen merged 2 commits into
masterfrom
chore/upgrade-dependencies

Conversation

@alexanderdavidsen

@alexanderdavidsen alexanderdavidsen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Upgrades all direct dependencies to their latest releases and ports the code to the new major APIs. Transitive dependencies are at the newest versions upstream allows (three exceptions listed below).

New majors

Crate From To Code change
aes-gcm 0.10 0.11 encryption.rs ported to the Generate / Array API
argon2 0.5 0.6 auth.rs ported; salt is now generated inside hash_password
sqlx 0.8 0.9 runtime-tokio-rustls split into runtime-tokio + tls-rustls-ring-webpki (same TLS backend as before)
tower-http 0.6 0.7 none
base64 0.22 0.23 none
dirs 6 7 none (only home_dir is used)

Everything else is updated within its semver range via cargo update (tokio 1.54, uuid 1.29, etc.).

Transitive crates that cannot move yet (pinned upstream)

Crate Locked Newest Why
matchit 0.8.4 0.8.6 axum 0.8.9 (latest) requires =0.8.4
crypto-common (0.1 line) 0.1.6 0.1.7 0.1.7 forces generic-array down from 0.14.9 to 0.14.7; the two are mutually exclusive, kept cargo's default resolution
libsqlite3-sys 0.37.0 0.39.0 sqlx-sqlite 0.9.0 (latest) requires <0.38; not compiled, see Security

Also

  • rust-version corrected from 1.75 to what the dependency graph actually requires: 1.94 for the server (sqlx 0.9), 1.89 for client and common.
  • actions/checkout v4 → v7.

Security

cargo audit (RustSec DB, 1527 advisories) now reports 0 vulnerabilities.

  • RUSTSEC-2023-0071 (rsa, Marvin attack): removed from the lockfile by sqlx 0.9.

  • RUSTSEC-2026-0459 (libsqlite3-sys, medium): not applicable, ignored with rationale in .cargo/audit.toml. The crate is in Cargo.lock only as an optional dependency of sqlx's SQLite driver, and only the postgres feature is enabled. Evidence it is not built:

    • cargo tree --workspace --target all -i libsqlite3-sys prints nothing
    • cargo deny check advisories (walks the real build graph) does not report it
    • the release tb and tb-server binaries contain no SQLite strings

    The fixed version cannot be selected until sqlx lifts its <0.38 cap; the ignore entry says to remove it then.

  • RUSTSEC-2026-0543 (chrono unmaintained, warning only): no vulnerability and no fixed version exists. Replacing chrono (jiff/time) is a separate migration and not part of this PR.

Because the two crypto crates changed major versions, this PR adds compatibility tests using fixtures generated with the old versions:

  • ciphertext produced by aes-gcm 0.10 still decrypts
  • a password hash produced by argon2 0.5 still verifies (and default parameters are unchanged: m=19456,t=2,p=1)

Not changed

Release-only GitHub Actions have newer majors (upload-artifact v7, download-artifact v8, docker/* actions, action-gh-release v3). They cannot be exercised by PR CI, so they are left for a separate change.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — 101 passed (96 before + 5 new)
  • cargo build --release --workspace
  • cargo audit — 0 vulnerabilities
  • Server smoke test against a disposable Postgres 17: migrations, register, login (good/bad password), /me, PUT/GET /items, PUT/GET /items/archive, /events, logout, /metrics
  • CI green

https://claude.ai/code/session_01HcqqCs5uaE9ejgz8DWNfok

Alexander Holte-Davidsen added 2 commits November 17, 2026 11:40
Bump all crates to their latest releases, including new majors:
aes-gcm 0.11, argon2 0.6, base64 0.23, dirs 7, sqlx 0.9, tower-http 0.7.

- Port encryption to the aes-gcm 0.11 Generate/Array API
- Port password hashing to the argon2 0.6 API (salt generated internally)
- Switch sqlx to the split runtime-tokio + tls-rustls-ring-webpki features
- Add compatibility tests: ciphertext from aes-gcm 0.10 and a hash from
  argon2 0.5 must still decrypt/verify
- Correct rust-version to what the dependency graph requires
- Bump actions/checkout to v7

Removes RUSTSEC-2023-0071 (rsa) from the lockfile.

Claude-Session: https://claude.ai/code/session_01HcqqCs5uaE9ejgz8DWNfok
RUSTSEC-2026-0459 is reported against a lockfile-only optional dependency
of sqlx's SQLite driver that is never compiled (postgres feature only).
sqlx-sqlite 0.9.0 caps libsqlite3-sys below the fixed 0.39.

Claude-Session: https://claude.ai/code/session_01HcqqCs5uaE9ejgz8DWNfok
@alexanderdavidsen

Copy link
Copy Markdown
Collaborator Author

Why three transitive crates are not at their newest version

Checked against crates.io and upstream main on 2026-11-17. None of these can be moved with any published release:

  • matchit 0.8.4 (newest 0.8.6): axum 0.8.9 is the newest published axum and declares matchit = "=0.8.4". An exact pin cannot be overridden (cargo update -p matchit --precise 0.8.6 fails to resolve). axum main has moved to matchit = "=0.9.2" but is unreleased.
  • crypto-common 0.1.6 (newest 0.1.7) vs generic-array 0.14.9: crypto-common 0.1.7 declares generic-array = "=0.14.7", so taking it downgrades generic-array from 0.14.9. Exactly one of the two can be newest. The 0.1 line is required by digest 0.10 ← sha2 0.10 ← sqlx-core 0.9.0 (newest sqlx).
  • libsqlite3-sys 0.37.0 (fixed in 0.39.0, RUSTSEC-2026-0459): sqlx-sqlite 0.9.0 is the newest published release and declares >=0.30.1, <0.38.0. sqlx main already allows <0.41.0, so the next sqlx release clears this. Setting default-features = false on sqlx does not remove the entry from Cargo.lock (tested), and the crate is never compiled.

Ways to remove the libsqlite3-sys lockfile entry today, none taken:

  1. Depend on sqlx from git main (unreleased code in the server).
  2. Drop the sqlx facade for sqlx-core + sqlx-postgres directly, and replace sqlx::migrate! with a hand-built migrator. Those crates are semver-exempt internals.
  3. Patch sqlx-sqlite with an empty stub crate.

Follow-up when sqlx > 0.9.0 ships: cargo update, then delete the ignore entry in .cargo/audit.toml.

@alexanderdavidsen
alexanderdavidsen merged commit e00622c into master Nov 17, 2026
3 checks passed
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.

1 participant