Skip to content

Commit 5988c96

Browse files
committed
fix: use constant time comparison when checking for unhashed tokens
1 parent 339ee6d commit 5988c96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

authorization/storage_authorization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ func (s *Store) filterAuthorizationsFn(filter influxdb.AuthorizationFilter) func
705705
}
706706

707707
return func(a *influxdb.Authorization) bool {
708-
if a.Token == token {
708+
if subtle.ConstantTimeCompare([]byte(a.Token), []byte(token)) == 1 {
709709
return true
710710
}
711711
return slices.Contains(allHashes, a.HashedToken)

0 commit comments

Comments
 (0)