fix(security): auth on internal APIs, secure UUID, SSRF blocklist (#10 #12 #14)#20
Merged
fix(security): auth on internal APIs, secure UUID, SSRF blocklist (#10 #12 #14)#20
Conversation
#10 — Add apiGuard to /api/search, /api/content, /api/compress Previously publicly accessible with no authentication. Now require API key or JWT like all other billable endpoints. Internal calls from Load API now forward the Authorization header. #12 — Replace Math.random() UUID with crypto.randomUUID() Payment records, API key IDs, and usage records now use cryptographically secure UUIDs. #14 — Add private IP blocklist for SSRF prevention /api/content URL validation now blocks localhost, 127.0.0.1, ::1, 10.x, 172.x, 192.168.x, 169.254.x, .internal, .local. Webhook delivery also validates endpoint URLs before sending. Closes #10, closes #12, closes #14. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Copy seed data from closed-source repo. On server startup, ensureSeedGenesInTable() loads these into the database (idempotent). - seed-genes.json: 28 core genes (repair, optimize, innovate) - seed-genes-external.json: 17 extended genes - seed-genes.schema.json: JSON schema for validation Categories: repair (21), optimize (14), innovate (10) Self-host users now see a populated Evolution Map immediately after docker compose up, and evolve analyze returns recommendations from day one. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This was referenced Apr 11, 2026
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.
Summary
Three security fixes for the server:
#10 — Internal APIs now require authentication
/api/search,/api/content,/api/compresswere publicly accessibleapiGuard(request, { tier: 'billable' })to all three#12 — Cryptographically secure UUIDs
generateUUID()replacedMath.random()withcrypto.randomUUID()#14 — SSRF private IP blocklist
/api/contentblocks localhost, 127.0.0.1, ::1, 10.x, 172.x, 192.168.x, 169.254.x, .internal, .localTest plan
/api/searchwithout auth → 401/api/contentwith auth → works/api/contentwith private IP URL → 400 blocked/api/context/loadend-to-end still works (internal calls forward auth)generateUUID()returns valid v4 UUID formatCloses #10, closes #12, closes #14.
🤖 Generated with Claude Code