Require exp when verifying access tokens - #97
Open
SashaMIT wants to merge 2 commits into
Open
Conversation
ruby-jwt only checks expiry when the claim is present. A signed token with no exp therefore never expired. Match protocol#1706, python-sdks#779, and node-sdks#710.
This was referenced Aug 19, 2026
frostbyte73
requested changes
Aug 25, 2026
| true, | ||
| { | ||
| algorithm: AccessToken::SIGNING_ALGORITHM, | ||
| required_claims: ["exp"], |
Member
There was a problem hiding this comment.
required_claims landed in ruby-jwt v2.3.0 - Gemfile.lock needs to bump the minimum from v2.2.3
required_claims landed in ruby-jwt 2.3.0. Keep the resolved 2.10.3, raise the floor so verify cannot install a gem that ignores the option.
Author
|
Thanks. Floor is now jwt >= 2.3.0 in the gemspec and Gemfile.lock. Resolved jwt stays 2.10.3.
|
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.
Summary
TokenVerifier#verifycalledJWT.decodewithoutrequired_claims. ruby-jwt only checksexpwhen the claim is present, so a valid HS256 token with noexpnever expired.This sets
required_claims: ["exp"]. Language-split of livekit/protocol#1706, livekit/python-sdks#779, and livekit/node-sdks#710. Distinct from #88 (jwt 3.x bump).Test plan
bundle exec rspec23 examples, 0 failures (2 pending mock-server)expraisesJWT::MissingRequiredClaimrequired_claimsand that case fails (token is accepted)Made with Cursor