Portal: Various bug fixes#5792
Merged
Merged
Conversation
The SessionInfoMiddleware validated JWT signature and expiry but did not check the typ header, allowing id_tokens (typ: JWT) to be accepted in place of access tokens (typ: at+jwt). Both token types share the same signing key and required claims, making this a real token confusion vulnerability when WEB_SDK_SESSION_TYPE=refresh_token. Fix by extracting the raw bearer token, rejecting any JWT whose typ header is not "at+jwt" before performing full signature verification. Covers both the portal API and the site admin API, which share the same SessionInfoMiddleware. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
carmenlau
reviewed
Jun 30, 2026
carmenlau
left a comment
Contributor
There was a problem hiding this comment.
The PR looks good, but the commit message for caa5b09 is a bit misleading. It says:
Fix by removing the entire secret entry when no certificates remain after
deletion, consistent with how other secret types handle cleanup.
However, the code actually rejects the deletion with an error. If it's not too much trouble, could you update the commit message?
Update .vettedpositions line numbers for middleware_session_info.go (lines shifted after new code was added) and update []interface{}{} to []any{} per go fix.
tung2744
force-pushed
the
fix-portal-auth
branch
from
June 30, 2026 08:45
f887242 to
7079e02
Compare
Contributor
Author
|
@carmenlau Fixed, thanks! |
carmenlau
approved these changes
Jun 30, 2026
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.
ref DEV-3679