Skip to content

Allow jwt 3.x (>= 2.2, < 4)#45

Merged
colin-strong merged 1 commit into
masterfrom
colin-strong/loosen-jwt-pin
May 21, 2026
Merged

Allow jwt 3.x (>= 2.2, < 4)#45
colin-strong merged 1 commit into
masterfrom
colin-strong/loosen-jwt-pin

Conversation

@colin-strong
Copy link
Copy Markdown
Contributor

@colin-strong colin-strong commented May 21, 2026

Part of https://github.com/shop/issues/issues/46298

Loosens the jwt dependency from ~> 2.2 to >= 2.2, < 4 so downstream consumers can pick up jwt 3.2.0 (which resolves HIGH-sev GHSA-c32j-vqhx-rx3x / CVE-2026-45363).

Why this is safe

The only JWT API this gem uses is JWT.encode(payload, key, "RS256") in lib/github_authentication/generator/app.rb. That signature is unchanged between jwt 2.x and 3.x.

All jwt 3.0 breaking changes are on the decode/verify side:

  • Mandatory signature verification before payload access
  • Removed deprecated claim verification methods
  • Stricter base64 decoding (RFC 4648)
  • RSA-2048 minimum key size
  • Removed HS512256 algorithm and rbnacl dependency

None of these affect this gem.

Context

Blocking https://github.com/shop/world/pull/732803 (jwt CVE bump in areas/platforms/trust-battery).

Requested by @colin-strong
Slack thread: https://shopify.enterprise.slack.com/archives/C09FSEMDKL0/p1779375258350209

@colin-strong colin-strong self-assigned this May 21, 2026
This matches the same change made in Shopify/minerva-gem v0.12.3 (#260).

The only JWT API this gem uses is JWT.encode(payload, key, "RS256")
in lib/github_authentication/generator/app.rb, which is unchanged
between jwt 2.x and 3.x. All jwt 3.0 breaking changes are on the
decode/verify side (mandatory signature verification before payload
access, removed deprecated claim methods, stricter base64 decoding,
RSA-2048 minimum, removed HS512256/rbnacl algorithms).

The current ~> 2.2 pin is blocking downstream consumers from picking
up jwt 3.2.0, which resolves a HIGH severity vulnerability
(GHSA-c32j-vqhx-rx3x / CVE-2026-45363).

Requested by Colin Strong <colin.strong@shopify.com>

Co-authored-by: Colin Strong <colin.strong@shopify.com>
@colin-strong colin-strong force-pushed the colin-strong/loosen-jwt-pin branch from 3ddf018 to 4db5b8e Compare May 21, 2026 18:40
@colin-strong colin-strong requested a review from nightsurgex2 May 21, 2026 18:41
@colin-strong colin-strong marked this pull request as ready for review May 21, 2026 18:41
@colin-strong colin-strong merged commit d6bcc60 into master May 21, 2026
6 checks passed
@colin-strong colin-strong deleted the colin-strong/loosen-jwt-pin branch May 21, 2026 19:15
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.

3 participants