Skip to content

libsql-server: jsonwebtoken 9 -> 10 (GHSA-h395-gr6q-cpjc) - #2346

Open
jrparks wants to merge 5 commits into
tursodatabase:mainfrom
jrparks:up/jsonwebtoken-10
Open

jrparks wants to merge 5 commits into
tursodatabase:mainfrom
jrparks:up/jsonwebtoken-10

Conversation

@jrparks

@jrparks jrparks commented Dec 1, 2026 •

Copy link
Copy Markdown

jsonwebtoken before 10.3.0 has a type confusion that can lead to an authorization bypass (GHSA-h395-gr6q-cpjc, CVE-2026-25537, medium). libsql-server uses it to verify the JWTs on its HTTP and gRPC endpoints, and main is on 9.3.0.

This moves libsql-server to jsonwebtoken 10 (Cargo.lock pins 10.3.0, the first fixed release; 10.4.0 needs rustc 1.88 and this repo pins 1.85.0).

  • Backend: aws_lc_rs, with default-features = false and the use_pem helpers. The other backend, rust_crypto, pulls in the rsa crate, which has an open advisory, so I avoided it. The cost is aws-lc-sys, a C build that needs cmake and a C compiler (the workspace already needs cmake for wabt-sys).
  • Behaviour change: v10 rejects a present-but-null exp claim. Token.exp is now omitted when unset (skip_serializing_if), so tokens issued by the tests and by anything using this struct keep validating. Tokens without exp still validate as before; exp is not a required claim here.
  • Nothing else needed code changes: parsers.rs, namespace/mod.rs and main.rs compile as they are.

cargo check -p libsql-server --tests, cargo fmt --check and the 28 auth tests pass. Cargo.lock gains aws-lc-rs, aws-lc-sys and a few small helper crates and has no new advisories.

The branch sits on top of the two CI commits from #2317 so the Extensions and Go checks can run; they drop out once #2317 merges. It touches the same exp line in jwt.rs as #2344 (chrono to jiff), so whichever merges second needs a one-line rebase.

ubuntu-latest moved to Ubuntu 26.04 between 2026-11-08 and 2026-11-11.
On 26.04 these jobs fail before reaching any test: CMake 4 rejects
wabt-sys 0.6.1 (cmake_minimum_required < 3.5) and the sqlite3_capi
bindings come out empty. The same jobs pass on 24.04, which every
green run so far used. Pinning restores CI for open PRs until the
toolchain issues are fixed properly.

Refs tursodatabase#2315
Go 1.27.4 refuses to link libsql_experimental.a: "disallowed LTO section
".llvmbc" in #cgo LDFLAGS". setup-go '>=1.21' picked 1.27.4 on the
first run of this PR; the last green run used 1.27.3. Pin until the
static library is built without embedded bitcode.

Refs tursodatabase#2315
jsonwebtoken before 10.3.0 has a type confusion that can lead to an
authorization bypass (CVE-2026-25537). Move to 10.x with the aws_lc_rs
backend (the default rust_crypto backend pulls in the rsa crate, which has
an open advisory) and the PEM helpers.

v10 rejects a present-but-null `exp` claim, so unset claims are no longer
serialized.
@jrparks

jrparks commented Dec 1, 2026

Copy link
Copy Markdown
Author

The only failing job is Run Tests, and only on connection::connection_core::test::test_many_concurrent ("database is locked" at connection_core.rs:676, or the 60s timeout at :708). The other 430 tests pass, including all the auth tests.

This test is flaky on its own, independent of this PR. Running it 30 times locally with cargo nextest run -p libsql-server --lib --retries 0 --stress-count 30 test_many_concurrent on rustc 1.85.0 gives 2 failures on this branch and 3 failures on the base commit without these changes. It also failed in the first Run Tests run of #2342, which does not touch libsql-server.

Could a maintainer re-run the failed job? I can't re-run single jobs from a fork.

This branch has not been deployed

No deployments
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