Skip to content
Merged
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
8 changes: 7 additions & 1 deletion internal/api/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,13 @@ func (a *API) updateMFASessionAndClaims(r *http.Request, tx *storage.Connection,
return apierrors.NewInternalServerError("Failed to get session's refresh token key").WithInternalError(terr)
}

counter := *session.RefreshTokenCounter + 1
// Incrementing the refresh token counter by 2 here is
// counter intuitive, but is important for security. It
// means that the previous refresh token (issued with
// AAL1) will no longer be able to issue AAL2 sessions.
// It forces the client to have received the refresh
// token from the MFA verification flow.
counter := *session.RefreshTokenCounter + 2
session.RefreshTokenCounter = &counter

issuedRefreshToken = (&crypto.RefreshToken{
Expand Down