What
The Bearer token has no expiry mechanism. An intercepted token is valid forever. There is no way to revoke or time-limit access.
Why
If a token is leaked, it remains valid indefinitely. Adding request-level expiration limits the window of exposure.
Scope
- Add
X-Request-Timestamp header requirement for admin requests
- Reject requests older than a configurable window (e.g., 5 minutes)
- Log rejected requests for security monitoring
- Make the window configurable via env var
Acceptance Criteria
Technical Context
src/routes/admin.ts:9-16 — auth middleware
- New env var:
ADMIN_REQUEST_MAX_AGE_MS (default: 300000)
What
The Bearer token has no expiry mechanism. An intercepted token is valid forever. There is no way to revoke or time-limit access.
Why
If a token is leaked, it remains valid indefinitely. Adding request-level expiration limits the window of exposure.
Scope
X-Request-Timestampheader requirement for admin requestsAcceptance Criteria
X-Request-Timestampare rejected (or allowed with warning)ADMIN_REQUEST_MAX_AGE_MSare rejected with 401Technical Context
src/routes/admin.ts:9-16— auth middlewareADMIN_REQUEST_MAX_AGE_MS(default: 300000)