Skip to content

Fix auth-bypass advisory in jsonwebtoken (CVE-2026-25537) - #23

Merged
WaylandYang merged 2 commits into
mainfrom
security/jsonwebtoken-cve-2026-25537
Aug 27, 2026
Merged

WaylandYang merged 2 commits into
mainfrom
security/jsonwebtoken-cve-2026-25537

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

jsonwebtoken below 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 first encode/decodecargo check and clippy both stay silent, because it is a runtime failure, not a type error. Enabling rust_crypto keeps 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.rs had 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 enforces exp.

WaylandYang and others added 2 commits August 28, 2026 00:56
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
WaylandYang merged commit ea414dc into main Aug 27, 2026
2 checks passed
@WaylandYang
WaylandYang deleted the security/jsonwebtoken-cve-2026-25537 branch August 27, 2026 17:09
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.
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