Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: constant time compare token (#17716)

p0ny7d437a9ba0bc
diff --git a/backend/api/directory-sync/webhook.go b/backend/api/directory-sync/webhook.go
index 318aa0ba2d..510af42e89 100644
--- a/backend/api/directory-sync/webhook.go
+++ b/backend/api/directory-sync/webhook.go
@@ -2,6 +2,7 @@ package directorysync
import (
"context"
+ "crypto/subtle"
"encoding/json"
"fmt"
"io"
@@ -602,7 +603,7 @@ func (s *Service) validRequestURL(ctx context.Context, c echo.Context) error {
return errors.Wrapf(err, "failed to unmarshal scim setting")
}
- if payload.Token != authorization {
+ if subtle.ConstantTimeCompare([]byte(payload.Token), []byte(authorization)) != 1 {
return errors.Errorf("invalid authorization token")
}