fix(security): hardening phase-0 — better-auth secret, audit pepper, IP redaction, realtime WS gate #13
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
javascript
question
wontfix
No milestone
No project
No assignees
1 participant
notification.notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
flndrn/briven!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/security-hardening-phase-0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Four security hardening fixes audited & ready to land before any deployment past localhost. Each commit is a single, focused change with a tracking ID (C-2/C-3/C-7/H-3) and was verified standalone.
b05a2f1 fix(api): drop hardcoded Better Auth secret fallback— removes the??'dev-insecure-fallback-change-in-prod'fallback inapps/api/src/lib/auth.ts. Boot-fail on missing secret outside development.0f4e57f fix(api): introduce BRIVEN_AUDIT_IP_PEPPER, drop reused 'dev-pepper'— splits the audit-IP pepper out fromBRIVEN_BETTER_AUTH_SECRET, removes the public'dev-pepper'fallback that defeated pseudonymisation if either env was unset. Updates 11 audit-call sites across admin/api-keys/db/deployments/invitations/me/project-env/project-members/projects.d64f6f5 fix(api+web): drop raw IP from /v1/me response—/v1/meno longer echoes the requester's plaintext IP back to the client (redundant with audit hashing, removes a casual data-exfil channel from a compromised browser).132d807 fix(realtime): refuse WS upgrade when shared secret unset—apps/realtimenow refuses to accept a WS upgrade ifBRIVEN_RUNTIME_SHARED_SECRETis not configured, instead of silently accepting any upgrade.Verification
pnpm install --frozen-lockfile: passpnpm -w typecheck: 15/15 successfulpnpm -w build: 11/11 successfulpnpm -w test: api/cli/schema all green; the@briven/realtimeand@briven/runtimefailures are the pre-existing bun-no-tests-found issue (also present on main, fix lives onfeat/observability-stackseparately) — NOT introduced by this branch.Test plan
BRIVEN_BETTER_AUTH_SECRETset → fails fast (C-2)ipHashderives fromBRIVEN_AUDIT_IP_PEPPER(C-3)🤖 Generated with Claude Code