Fix auth-bypass advisory in jsonwebtoken (CVE-2026-25537) - #23
Merged
Merged
Conversation
CVE-2026-25537: type confusion below 10.3.0 can bypass authorization, and this crate signs and verifies every session token we issue. The bump is not just a version number. jsonwebtoken 10 moved to a rustls-style CryptoProvider, and with no backend feature selected it compiles clean and then panics at the first encode/decode — cargo check and clippy both stay silent. The rust_crypto feature keeps us on the pure-Rust path the rest of the tree already takes (reqwest on rustls, sqlx on tls-rustls) and off a C toolchain in the Docker build. Adds the regression test that caught it: auth had no coverage at all, so a library's default validation semantics — the part a compiler cannot see — went unverified across a major bump.
WaylandYang
added a commit
that referenced
this pull request
Aug 28, 2026
CVE-2026-25537: type confusion below 10.3.0 can bypass authorization, and this crate signs and verifies every session token we issue. The bump is not just a version number. jsonwebtoken 10 moved to a rustls-style CryptoProvider, and with no backend feature selected it compiles clean and then panics at the first encode/decode — cargo check and clippy both stay silent. The rust_crypto feature keeps us on the pure-Rust path the rest of the tree already takes (reqwest on rustls, sqlx on tls-rustls) and off a C toolchain in the Docker build. Adds the regression test that caught it: auth had no coverage at all, so a library's default validation semantics — the part a compiler cannot see — went unverified across a major bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
jsonwebtokenbelow 10.3.0 has a type confusion that can lead to authorization bypass (GHSA-h395-gr6q-cpjc). We were on 9.3.1, and this crate signs and verifies every session token. Bumped to 10.4.0.The bump needed more than a version number. jsonwebtoken 10 adopted a rustls-style
CryptoProvider. With no backend feature selected the crate compiles cleanly and then panics at the firstencode/decode—cargo checkandclippyboth stay silent, because it is a runtime failure, not a type error. Enablingrust_cryptokeeps us on the pure-Rust path the rest of the tree already uses (reqwest on rustls, sqlx on tls-rustls), and avoids pulling a C toolchain into the Docker build.Adds the test that caught it.
auth.rshad no coverage, so a major bump of the library that guards every request was landing on nothing but a green compile. The new test pins what the compiler cannot see: default validation accepts our own HS256 token, rejects one signed with a different key, and enforcesexp.