Uh oh!
There was an error while loading. Please reload this page.
fix(backend): Reject JWT-template tokens on the acceptsToken any/array header path - #9511
Conversation
…y header path Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
@clerk/astro@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/electron@clerk/electron-passkeys@clerk/eslint-plugin@clerk/expo@clerk/expo-google-signin@clerk/expo-passkeys@clerk/express@clerk/fastify@clerk/hono@clerk/localizations@clerk/nextjs@clerk/nuxt@clerk/react@clerk/react-router@clerk/shared@clerk/tanstack-react-start@clerk/testing@clerk/ui@clerk/upgrade@clerk/vuecommit: |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthroughThe fallback session-token path now rejects JWT-template tokens with non-session categories before session-token verification. The regression tests cover header and cookie carriers, Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to This change rejects JWT-template tokens on the affected session-token header paths and adds regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Uh oh!
There was an error while loading. Please reload this page.
Description
Follow-up to #9469 (SEC-340). That PR rejects JWT-template tokens (
cat=cl_B7d4PD222AAA) on the session-only header and cookie paths, butauthenticateAnyRequestWithTokenInHeader— used whenacceptsTokenis'any'or an array that includes'session_token'— still fell throughisMachineToken()→verifyToken()→signedIn, so a template token in theAuthorizationheader was accepted as asession_tokenon those routes. Same consequence as the original report: the token has nosidand outlives revocation of the session that minted it, and it carries nosts, so a pending session presents as fully signed in.This adds the same
hasNonSessionJwtCategorycheck before the session-token branch of that path, returningsigned-out/token-type-mismatch, and extends the SEC-340 regression tests to coveracceptsToken: 'any'and['session_token', 'm2m_token'].Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code