Skip to content

Closed#394

Closed
opastorello wants to merge 1 commit into
ArnasDon:mainfrom
opastorello:security/timing-safe-cron
Closed

Closed#394
opastorello wants to merge 1 commit into
ArnasDon:mainfrom
opastorello:security/timing-safe-cron

Conversation

@opastorello

@opastorello opastorello commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closed - not needed

@opastorello
opastorello requested a review from ArnasDon as a code owner July 16, 2026 15:42
@opastorello
opastorello force-pushed the security/timing-safe-cron branch from b54838a to 25fb198 Compare July 16, 2026 15:47
Replaces simple string equality with timingSafeEqual in automations
cron endpoint to prevent timing attacks. Mirrors the pattern already
used in flows cron (route.ts:42).

**Risk**: Theoretical timing attack where an attacker with network
access could measure response latency to recover AUTOMATION_CRON_SECRET
byte-by-byte. Very low practical risk (cron endpoints not public), but
this brings auth consistency across both cron routes.

**Changes**:
- Import timingSafeEqual from node:crypto
- Replace `supplied !== expected` with constant-time comparison
- Add comment explaining the defense

**Testing**: typecheck + lint clean (0 errors).

Refs: SECURITY_AUDIT_2026-07-16.md (finding #2 — LOW severity)
@opastorello
opastorello force-pushed the security/timing-safe-cron branch from 25fb198 to cfca7dd Compare July 16, 2026 15:48
@opastorello
opastorello deleted the security/timing-safe-cron branch July 16, 2026 15:50
@opastorello opastorello changed the title security: timing-safe compare for cron secret + audit report Closed Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant