You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@clerk/backend 3.27.0 accepts an OIDC ID token as a session token (GHSA-wpqf-h9rq-rg73). The relay calls verifyToken() directly in infra/relay/src/http/Api.ts, and that path was not covered by Clerk's server-side category tagging on any release before 3.28.0.
The catalog pin is now @clerk/backend 3.31.2, the newest 3.x on npm (published 2026-11-19, above the 3.28.0 fix). pnpm-lock.yaml is updated to match.
@clerk/shared moves from 4.44.1 to 4.48.1 with it. Backend 3.31.2 depends on ^4.48.1, and the existing "@clerk/shared": "catalog:" override forces every Clerk package onto that one version. @clerk/clerk-js, @clerk/react, @clerk/expo, and @clerk/electron already accept ^4.44.1, so 4.48.1 stays inside their ranges. Both releases are still inside pnpm's one-day release age, so they are listed in minimumReleaseAgeExclude.
No local header check was added. In 3.31.2, verifyToken() rejects a JWT before signature verification when cat is anything other than the session category cl_B7d4PD111AAA (JWT templates remain verifiable for direct callers). That includes a missing cat, which is how older OIDC ID tokens are shaped, and cat === 'cl_B7d4PD444AAA', the category Clerk stamps on ID tokens. The advisory's pre-check is the workaround for callers who cannot upgrade, and it only covers that one category. The installed 3.31.2 build rejects both shapes with token-invalid / "Invalid session token category." A real session token (cl_B7d4PD111AAA) continues on to signature verification.
The relay's OAuth fallback does not reopen the hole. A failed verifyToken() falls through to authenticateRequest({ acceptsToken: "oauth_token" }), which only accepts oat_ tokens or JWTs whose typ is at+jwt. An ID token is neither.
npm latest for @clerk/backend is 3.31.2. The published dist rejects cat: cl_B7d4PD444AAA and a missing cat with token-invalid before checking the signature, and sends a session-category token through to token-invalid-signature.
vp test run --dir . in infra/relay: 37 files, 318 tests passed.
vp run typecheck passed for t3code-relay, @t3tools/web, @t3tools/desktop, and @t3tools/mobile (pre-existing schema-brand suggestions only).
Grok 4.7 via Cursor cloud agent.
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
@clerk/backend 3.27.0 accepts OIDC ID tokens as session tokens
(GHSA-wpqf-h9rq-rg73). 3.31.2 rejects them inside verifyToken(), which
the relay calls directly. The catalog override also moves @clerk/shared
to 4.48.1, the version that release requires.
Grok 4.7 via Cursor cloud agent.
Co-authored-by: Oskar Freye <oskar@freye.tech>
Reviewing files that changed from the base of the PR and between 0c69537 and c206ab2.
Files ignored due to path filters: 1
pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The workspace updates the Clerk backend and shared package versions, and adds both versions to the release-age exclusion list.
Changes: Clerk dependency versions
Layer / File(s)
Summary
Update Clerk versions and exclusions pnpm-workspace.yaml
The catalog updates @clerk/backend to 3.31.2 and @clerk/shared to 4.48.1. The release-age exclusion list adds both versions. A comment describes the backend dependency on the shared version and the override.
This updates the Clerk backend and shared packages to pick up a fix that rejects OIDC ID tokens as session tokens in the relay. No actionable merge risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(relay): bump @clerk/backend to 3.31.2" names the main change: the catalog pin for @clerk/backend moves from 3.27.0 to 3.31.2. The raw summary confirms this, and the objectives describe …
Description check
The description covers the problem, the change, scope, and verification. It follows the template's Problem, Change, Scope, and Verification sections, with the advisory, the affected call site, the dep…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(relay): bump @clerk/backend to 3.31.2" names the main change: the catalog pin for @clerk/backend moves from 3.27.0 to 3.31.2. The raw summary confirms this, and the objectives describe the same bump as the security fix. It uses a conventional commit format and is specific. It does not mention the @clerk/shared move, which is a secondary change and not required in the title.
Full details: Description check
Explanation
The description covers the problem, the change, scope, and verification. It follows the template's Problem, Change, Scope, and Verification sections, with the advisory, the affected call site, the dependency change, and the test results. Two template gaps remain. The Problem section does not describe reproduction steps, and the Verification section cites test counts and npm checks but does not give observed results for a manual check of the relay path. The description also includes the agent footer, which the template asks for. Overall the description is mostly complete, so it passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 9a9f9dd and 0c69537.
Files ignored due to path filters: 1
pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 1
pnpm-workspace.yaml
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Problem
@clerk/backend3.27.0 accepts an OIDC ID token as a session token (GHSA-wpqf-h9rq-rg73). The relay callsverifyToken()directly ininfra/relay/src/http/Api.ts, and that path was not covered by Clerk's server-side category tagging on any release before 3.28.0.Tracked in https://github.com/draht-dev/ops/issues/142 (parent https://github.com/draht-dev/ops/issues/133).
Change
The catalog pin is now
@clerk/backend3.31.2, the newest 3.x on npm (published 2026-11-19, above the 3.28.0 fix).pnpm-lock.yamlis updated to match.@clerk/sharedmoves from 4.44.1 to 4.48.1 with it. Backend 3.31.2 depends on^4.48.1, and the existing"@clerk/shared": "catalog:"override forces every Clerk package onto that one version.@clerk/clerk-js,@clerk/react,@clerk/expo, and@clerk/electronalready accept^4.44.1, so 4.48.1 stays inside their ranges. Both releases are still inside pnpm's one-day release age, so they are listed inminimumReleaseAgeExclude.No local header check was added. In 3.31.2,
verifyToken()rejects a JWT before signature verification whencatis anything other than the session categorycl_B7d4PD111AAA(JWT templates remain verifiable for direct callers). That includes a missingcat, which is how older OIDC ID tokens are shaped, andcat === 'cl_B7d4PD444AAA', the category Clerk stamps on ID tokens. The advisory's pre-check is the workaround for callers who cannot upgrade, and it only covers that one category. The installed 3.31.2 build rejects both shapes withtoken-invalid/ "Invalid session token category." A real session token (cl_B7d4PD111AAA) continues on to signature verification.The relay's OAuth fallback does not reopen the hole. A failed
verifyToken()falls through toauthenticateRequest({ acceptsToken: "oauth_token" }), which only acceptsoat_tokens or JWTs whosetypisat+jwt. An ID token is neither.Scope
Security dependency bump for https://github.com/draht-dev/ops/issues/142. No relay behavior change beyond the patched verifier. Not merged and not deployed.
Verification
latestfor@clerk/backendis 3.31.2. The publisheddistrejectscat: cl_B7d4PD444AAAand a missingcatwithtoken-invalidbefore checking the signature, and sends a session-category token through totoken-invalid-signature.vp test run --dir .ininfra/relay: 37 files, 318 tests passed.vp run typecheckpassed fort3code-relay,@t3tools/web,@t3tools/desktop, and@t3tools/mobile(pre-existing schema-brand suggestions only).Grok 4.7 via Cursor cloud agent.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.