Skip to content

Harden auth, sync, and Supabase security - #5

Closed
Suydev wants to merge 9 commits into
mainfrom
codex/security-and-reliability-hardening
Closed

Suydev wants to merge 9 commits into
mainfrom
codex/security-and-reliability-hardening

Conversation

@Suydev

@Suydev Suydev commented Jun 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • harden auth, proxying, backup/restore, runtime boot, and server-side Supabase authority without changing the UI
  • move exposed privileged RPCs behind an unexposed helper schema, enforce invoker boundaries, tighten attendee privacy, and add live cross-user security proofs
  • remove five live-proven redundant indexes while retaining unproven advisor candidates
  • support modern Supabase sb_secret_ keys with legacy fallback, add CI secret detection, Dependabot, current Actions versions, and dependency overrides
  • add Lighthouse CI, per-file audit verification, and release checks for migrations 008/009

Verification

  • GitHub Actions: Node 20/22, SQL validation, dependency review, workflow CodeQL analysis, and Lighthouse passed
  • branch CodeQL alerts: 0
  • Dependabot alerts: 0
  • npm audit: 0 vulnerabilities
  • live Supabase security verifier passed, including cross-user RLS/storage/RPC and inactive-event attendee privacy
  • Supabase Security Advisor: all database warnings resolved; only plan-gated leaked-password protection remains
  • runtime glue, Supabase sync, auth bridge, boot performance, data integrity, docs validation, and current-file audit passed

Remaining owner actions

Lighthouse policy

  • The /auth LCP target remains visible as a warning at 4.0s because UI changes are out of scope; the overall performance score remains a hard PR gate.

@github-actions

github-actions Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:

  • βœ… 0 vulnerable package(s)
  • βœ… 0 package(s) with incompatible licenses
  • βœ… 0 package(s) with invalid SPDX license definitions
  • ⚠️ 5 package(s) with unknown licenses.
  • ⚠️ 46 packages with OpenSSF Scorecard issues.

View full job summary

@supabase

supabase Bot commented Jun 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project vteqquoqvksshmfhuepu because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings β†—οΈŽ.


Preview Branches by Supabase.
Learn more about Supabase Branching β†—οΈŽ.

@Suydev
Suydev force-pushed the codex/security-and-reliability-hardening branch from c4b9367 to aaf1fd3 Compare June 20, 2026 08:48
Comment thread scripts/generate-current-audit.mjs Fixed
Comment thread scripts/patch-lhci-js-yaml.mjs Fixed
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

πŸ‘‹ This PR hasn't had any activity for 14 days.

It will be automatically closed in 7 days unless there's a review, commit, or comment.

  • Rebase and push to refresh it
  • Add a comment if you need help getting it merged

@github-actions github-actions Bot added the stale label Jul 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

πŸ”’ This PR was automatically closed due to inactivity.

Feel free to reopen it when you're ready to continue!

@github-actions github-actions Bot closed this Jul 15, 2026
Suydev pushed a commit that referenced this pull request Oct 8, 2026
A patcher that fails to match its anchor leaves the shipped bundle
byte-identical to the on-disk file and the server serves it happily. The
feature is simply gone, with no error anywhere.

Mutation testing against the real bundles showed the gap was wide: corrupting
one anchor and re-running the real patcher left _criticalPatchFailures EMPTY
for the sync store, session sync, access gate, group tour, settings,
onboarding and leaderboard patchers -- including the onboarding patch that is
the only thing requiring a verified cloud write before a profile is marked
complete.

getPatchedAuthBundle already asserted its own post-condition correctly. This
makes that the default rather than an accident of one patcher, via
noteAnchorMiss().

Note: sessionsync patch #5 ('if(!f())return await _(),{synced:0,failed:0}')
is a substring of patch #4's replacement. Mutating only the first occurrence
in the raw bundle therefore proves nothing -- both must be mangled.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Suydev pushed a commit that referenced this pull request Oct 8, 2026
Adds scripts/test-bundle-patch-escalation.mjs, which loads the real server.mjs
and runs the real getPatched*Bundle() against the real public/assets/*.js twice:

  - happy path: every patched buffer must parse, and NO patcher may escalate
    against the bundles actually shipped (a false positive would put a red
    startup banner on a healthy install);
  - mutation path: corrupt one anchor per patcher in the real bytes, re-run,
    and require the failure to reach _criticalPatchFailures.

Two harness details that produce false results if you get them wrong:

  - An anchor can be a substring of a LATER patch's own replacement
    (sessionsync #5 'await _()' vs #4's replacement), so the mutation must
    mangle EVERY occurrence, not the first.
  - The memo caches are module-scoped 'let'. Resetting them via
    globalThis[x] = null compiles, runs, and clears nothing -- the patcher
    returns its first clean result and the mutation is never observed. The
    epilogue is in the same module, so it resets the binding by bare name.

Also adds post-condition assertions to six patchers that lacked them
(singlegroup tour, sessionsync, syncstore, settings, appaccessgate,
onboarding). getPatchedAuthBundle already did this correctly; the rest only
reported an 'applied N/M' count that nothing acted on.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants