Repository navigation
P0: timing-safe secret, report IDOR hardening, OpenAPI sync - #35
Merged
Merged
Conversation
|
Deployment failed for project contract-cheq with the following error: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
P0-3 hardening, no merge/deploy requested.
1. Timing-safe CRON_SECRET (LOW)
server/secretCompare.js:timingSafeEqualStringhashes both sides to fixed-length sha256 digests beforecrypto.timingSafeEqual(length-mismatch safe, no length leak) andisBearerAuthorized.server/index.js/api/cleanup andserver/siteConfig.jscanonicalHost now use it instead of plain!==.2. /api/report/:id IDOR hardening
freeViewOf(free preview); the full paid report is only via POST /api/unlock-analysis (reference+email grant check). public/index.html resume flow calls /api/report/:id with NO credentials and depends on the free preview, so requiring full auth would break the demo/resume flow.x-payment-reference(+ optionalx-receipt-email, same credential as /api/credits) -> full report only if the grant exists, email matches, and grant.unlocked already includes this id; otherwise the same generic 404 as a missing report (no existence/unlock-state leak). Rejects traversal-style ids (400).server/p0Hardening.test.js: timing-safe helper cases + report endpoint cases (free-only unauthenticated, bogus/not-unlocked/wrong-email = identical 404 to missing, full report after unlock-analysis, traversal rejected).3. OpenAPI sync
Tests:
env -u GH_TOKEN npm ci --ignore-scripts && npm test-> 136 pass / 0 fail (134 pre-existing + 2 new).