Harden product security boundaries#326
Conversation
Prevent cross-account offline replay, make sessions revocable, bound untrusted request bodies, and require explicit AI metadata consent. Store new attachments privately behind owner/share authorization and verify database TLS by default. Co-Authored-By: OpenAI Codex <codex@openai.com>
Pin CI dependencies, require verified SSH host keys, and fail closed on a bad production smoke check. Sandbox the Mac target, enable hardened runtime, revoke server sessions on native sign-out, and keep full note bodies out of Spotlight. Co-Authored-By: OpenAI Codex <codex@openai.com>
Bring the security branch up to date without rewriting its reviewed commits; main advanced only through automated screenshot archives. Co-Authored-By: OpenAI Codex <codex@openai.com>
|
A multi-agent code review of this branch confirmed 10 issues — two deploy-breaking (the middleware CSRF check compared Origin against the internal listen origin; the DB TLS default flip rejected the droplet's self-signed Postgres), one defeating revocation for all pre-deploy JWTs, plus data-loss and behavior regressions (byte-vs-char note cap, CSP breaking legacy images, offline-op loss on sign-out and legacy-DB discard, sign-out revoking all devices, AI metadata silently off, upload-quota leak). All ten are fixed in e8b08f1, with tests updated/added (151 passing) and the CSRF fix verified against Known follow-up: the iOS client's sign-out still POSTs /api/auth/revoke, so native sign-out remains "sign out everywhere" until that call is removed. |
Summary
Verification
npx tsc --noEmitnpm test(148 tests)npm run buildnpm audit --audit-level=high(0 vulnerabilities)xcodegen generateand unsigned KeepMac x86_64 buildNo screenshot was added because the rendered controls and layout are unchanged.
Rollout notes
AUTH_URLDATABASE_CA_CERT; insecure TLS now requires an explicit loopback-only opt-inDEPLOY_KNOWN_HOSTSsecret before merge or the deploy job will skipAI_METADATA_ENABLED=trueis setSECURITY.md