fix(security): timing attack, rate limiter за прокси, хардкод ID в скриптах (20.09.2026)
This commit is contained in:
@@ -58,7 +58,7 @@ async def verify_telegram_initdata(init_data: str):
|
||||
hashlib.sha256
|
||||
).hexdigest()
|
||||
|
||||
if calculated_hash != received_hash:
|
||||
if not hmac.compare_digest(calculated_hash, received_hash):
|
||||
raise HTTPException(401, "Invalid initData signature")
|
||||
|
||||
# Извлекаем данные пользователя
|
||||
|
||||
Reference in New Issue
Block a user