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
3 changes: 2 additions & 1 deletion src/routes/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ function verifyWsToken(token: string, expectedSlab?: string): { isValid: boolean

const [slabAddress, timestampStr, signature] = parts;
const timestamp = parseInt(timestampStr, 10);

if (Number.isNaN(timestamp)) return { isValid: false, slabAddress: null };

// Check timestamp is within last 5 minutes and not in the future (30s clock skew tolerance)
const now = Date.now();
if (now - timestamp > 5 * 60 * 1000 || timestamp > now + 30_000) {
Expand Down
Loading