Repository navigation
Check claims on verified decodes from a signature-disabled PyJWT - #1240
Open
Dilshad-Tanvi wants to merge 1 commit into
Open
Dilshad-Tanvi wants to merge 1 commit into
Dilshad-Tanvi wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
A
PyJWTinstance built withoptions={"verify_signature": False}storesverify_exp,verify_aud,verify_issand the other claim checks as False inself.options, butdecode_complete()still verifies the signature unless the call itself disables it, soinst.decode(token, key, algorithms=["HS256"], audience="api", issuer="https://idp")(withoptions=Noneoroptions={"verify_signature": True}) checks the signature and then accepts an expired token whoseaudandissdo not match. This is the instance-level counterpart of the per-call options case fixed for GHSA-gvp8-978c-rx2q:_merge_options()now rebuilds the claim defaults from the library defaults plus the options the instance was explicitly constructed with whenever the decode verifies the signature, so claim options set explicitly on the instance still apply and signature-disabled decodes behave as before.