security: fix 3 open-source blockers (docs + timing attack) - #126
Merged
Conversation
1) Internal docs moved out of the repo
Five docs that leaked API key names, partner contracts, Railway
service names, deployment budgets and 6-12 month business roadmap
removed from HEAD and saved to a private location outside the repo:
- docs/solana-landing-deployment-checklist.md
- docs/solana-landing-tiered-architecture.md
- docs/solana-landing-cost-model.md
- docs/solana-landing-active-bench-plan.md
- docs/france-cryptos-roadmap.md
.gitignore picks up both the legacy filenames and a tripwire
pattern (*-checklist / *-cost-model / *-roadmap / *-internal in
docs/) so a future contributor can't reintroduce the same shape
of internal-only doc without an explicit override.
NOTE: git history still contains these files. Before flipping the
repo public, run a one-off rewrite (git filter-repo --invert-paths
--path docs/solana-landing-... etc) and force-push to a fresh
public mirror. Not done here because it requires force-push
coordination + a backup.
2) Constant-time CRON_SECRET comparison
/api/cron/health-check now compares the Authorization header with
crypto.timingSafeEqual instead of .
The prior `===` shortcut leaked the secret one byte at a time
under a remote timing attack (response latency varied with prefix
match length). Pads provided header to expected length first to
avoid throwing on mismatched buffer sizes, then ANDs with a
length check so a shorter-but-prefix-matching header still fails.
3) Fail-closed in production when secret missing
The previous `if (!secret) return true; // dev mode` would have
silently published the route if CRON_SECRET fell off the vercel
env (typo, rotation gap, project rename). Now production refuses
any unsignaled request; dev keeps the permissive fallback.
.vercel/project.json was flagged in the audit as committed - confirmed
NOT committed (already in .gitignore). False positive, no action.
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.
Avant d'open-source : 3 fixes critiques.
git filter-repo --invert-paths --path docs/solana-landing-...+ force-push vers mirror public.crypto.timingSafeEqual()au lieu de===. Pad provided header pour éviter throw sur length mismatch..vercel/project.jsonétait un faux positif de l'audit (jamais commité).