fix: close CRON_SECRET fail-open auth in check-renders + sponsor-outreach#605
Merged
codercatdev merged 1 commit intodevfrom Mar 5, 2026
Merged
fix: close CRON_SECRET fail-open auth in check-renders + sponsor-outreach#605codercatdev merged 1 commit intodevfrom
codercatdev merged 1 commit intodevfrom
Conversation
…each When CRON_SECRET env var is undefined, the auth check compared against 'Bearer undefined' — an attacker could bypass auth by sending that header. Now checks !cronSecret first and returns 503 if not configured, matching the pattern already applied to check-research and ingest routes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fix: CRON_SECRET Fail-Open Auth Vulnerability
The Bug
Both
check-rendersandsponsor-outreachcron routes had an auth check of the form:When
CRON_SECRETis not set in the environment,process.env.CRON_SECRETevaluates toundefined, making the comparison string"Bearer undefined". An attacker who knows this pattern can bypass authentication entirely by sending:This is a fail-open vulnerability — a missing env var silently disables auth instead of blocking requests.
The Fix
Both files now follow the same fail-close pattern already used in
check-researchandingestroutes:Key changes:
process.env.CRON_SECRETinto aconst cronSecretvariable!cronSecretbefore the comparison — returns 503 if not configured (fail-closed)cronSecretin the comparison instead ofprocess.env.CRON_SECRETFiles Changed
app/api/cron/check-renders/route.ts— uses[PIPELINE]log prefix,Response.json()formatapp/api/cron/sponsor-outreach/route.ts— uses[SPONSOR]log prefix,new Response()formatVerification
TypeScript check is clean (pre-existing
@vercel/analyticstype errors are unrelated to this change).