Skip to content

Commit 69b3ec3

Browse files
authored
scim: use hmac.compare_digest for bearer token check (open-webui#23577)
1 parent a600f67 commit 69b3ec3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backend/open_webui/routers/scim.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
NOTE: This is an experimental implementation and may not fully comply with SCIM 2.0 standards, and is subject to change.
66
"""
77

8+
import hmac
89
import logging
910
import uuid
1011
import time
@@ -278,7 +279,7 @@ def get_scim_auth(request: Request, authorization: Optional[str] = Header(None))
278279
if hasattr(scim_token, 'value'):
279280
scim_token = scim_token.value
280281
log.debug(f'SCIM token configured: {bool(scim_token)}')
281-
if not scim_token or token != scim_token:
282+
if not scim_token or not hmac.compare_digest(token, scim_token):
282283
raise HTTPException(
283284
status_code=status.HTTP_401_UNAUTHORIZED,
284285
detail='Invalid SCIM token',

0 commit comments

Comments
 (0)