Repository navigation
Sign the forged token of the key confusion test without JWT.encode - #725
Merged
Conversation
## Motivation and Context `test_rejects_hs256_key_confusion` presents the verifier with a token signed with HS256, using the RSA public key as the HMAC secret, and expects it to be refused. It built that token with `JWT.encode`. jwt 3.3.2 refuses to sign with a public key or a certificate as an HMAC secret, so the test now errors with `JWT::EncodeError` before it reaches the verifier, and CI fails on every Ruby version that resolves jwt 3.3.2. The test now computes the HMAC itself, so it keeps checking the verifier with every jwt version. The verifier is unchanged. ## How Has This Been Tested? `test/mcp/server/oauth/jwt_verifier_test.rb`, run with jwt 3.3.0 and with jwt 3.3.2. Before the change it errors with jwt 3.3.2. ## Breaking Changes None.
koic
force-pushed
the
sign_the_forged_token_of_the_key_confusion_test_without_jwt_encode
branch
from
November 28, 2026 15:42
bc0d2b9 to
88cdb52
Compare
koic
deleted the
sign_the_forged_token_of_the_key_confusion_test_without_jwt_encode
branch
November 28, 2026 15:47
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.
Motivation and Context
test_rejects_hs256_key_confusionpresents the verifier with a token signed with HS256, using the RSA public key as the HMAC secret, and expects it to be refused. It built that token withJWT.encode. jwt 3.3.2 refuses to sign with a public key or a certificate as an HMAC secret, so the test now errors withJWT::EncodeErrorbefore it reaches the verifier, and CI fails on every Ruby version that resolves jwt 3.3.2.The test now computes the HMAC itself, so it keeps checking the verifier with every jwt version. The verifier is unchanged.
How Has This Been Tested?
test/mcp/server/oauth/jwt_verifier_test.rb, run with jwt 3.3.0 and with jwt 3.3.2. Before the change it errors with jwt 3.3.2.Breaking Changes
None.
Types of changes
Checklist