Skip to content
Open
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
1 change: 1 addition & 0 deletions sentinel/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async def internal_snapshot(nonce: str, request: Request) -> Response:
"""Single-use JPEG endpoint for the Obico ML API URL-fetch flow."""
if internal_token is not None:
t = request.query_params.get("t") or ""
# Use constant-time comparison to prevent timing side-channel attack
if not t or not hmac.compare_digest(t, internal_token):
raise HTTPException(status_code=403, detail="Forbidden: Invalid internal token")

Expand Down