Review 11 — Hardening: DB-enforced cert uniqueness, race-safe issuance, token validation - #35
Draft
ArneeMe wants to merge 1 commit into
Draft
Conversation
…idation Findings from an inline security pass over the new attack surfaces: - Unique index on certificates(organization_id, submission_id) (migration + baseline) turns the API's check-then-insert idempotency into a DB guarantee; the cert POST catches the violation from a concurrent double-click and returns the winning row instead of 500. - Invite redemption validates the token's UUID shape before querying, so a malformed token is a clean 404 instead of a Hasura type error surfacing as 500. - Baseline schema comments updated to the 24h-TTL retention model (they still described delete-at-issuance); ROADMAP drops the now- completed designer-translation item. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFHkXUuHJME4cF9AJWbavB
Deploying inf319-certificate with
|
| Latest commit: |
25ae32b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://908652f3.inf319-certificate.pages.dev |
| Branch Preview URL: | https://claude-review-11-hardening.inf319-certificate.pages.dev |
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.
Stacked on #34 (part 11, the top of the review stack). Small, security-relevant — review alongside #29/#32.
Outcome of an inline security pass over every new attack surface (auth guards, invites, platform admin, feedback, branding, issuance, retention, rate limiting). Two things warranted code; the rest checked out clean — full notes posted on #29.
certificates(organization_id, submission_id)(2026-07-cert-unique.sql+ baseline). The cert POST's check-then-insert had a small race window under concurrent double-clicks; now the database rejects the second insert and the API catches it and returns the winning row (alreadyIssued: true) instead of erroring. Before running the migration: the file includes a query to check for pre-idempotency duplicate rows; dedupe first if it returns anything.Verification: typecheck, lint, 110 unit tests, production build pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BFHkXUuHJME4cF9AJWbavB
Generated by Claude Code