Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardening suggestions for spiff-arena / bug/open_id_redirect_issue #2154

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ def parse_jwt_token(cls, authentication_identifier: str, token: str) -> dict:
str(current_app.secret_key),
algorithms=[SPIFF_GENERATED_JWT_ALGORITHM],
audience=SPIFF_GENERATED_JWT_AUDIENCE,
options={"verify_exp": False},
)
options={"verify_exp": True})
else:
algorithm = str(header.get("alg"))
json_key_configs = cls.jwks_public_key_for_key_id(authentication_identifier, key_id)
Expand Down Expand Up @@ -479,7 +478,7 @@ def get_auth_token_from_refresh_token(cls, refresh_token: str, authentication_id
def decode_auth_token(auth_token: str) -> dict[str, str | None]:
"""This is only used for debugging."""
try:
payload: dict[str, str | None] = jwt.decode(auth_token, options={"verify_signature": False})
payload: dict[str, str | None] = jwt.decode(auth_token, options={"verify_signature": True})
return payload
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable all verifications in jwt.decode call.

except jwt.ExpiredSignatureError as exception:
raise TokenExpiredError(
Expand Down
Loading