Skip to content

feat(rules): supabase-rls probes tables in a fixed name order, raises its caps to 30/40 and counts unchecked tables #2104 - #2191

Merged
nc9 merged 1 commit into
mainfrom
boat/supabase-rls-cap-2104
Nov 21, 2026
Merged

nc9 merged 1 commit into
mainfrom
boat/supabase-rls-cap-2104

Conversation

@nc9

@nc9 nc9 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Closes #2104

Summary

security/supabase-rls could find an open table but could never report a real app clean: it probed at most 8 tables per project and 10 per audit, and the tables it picked depended on the order scripts were fetched in.

  • Order: sources are read in script URL order, projects are taken in project ref order, and tables in code-unit name order (compareNames, not localeCompare, so the order is the same on every machine). Past the cap, the first tables by name are probed. This is documented on the rule page.
  • Cap raised: 30 tables per project (was 8) and 40 per audit (was 10). Projects stay at 2. Why raise and not keep: each probe is a HEAD with no body read, the run already stops at the first 429 or challenge (isThrottledOrChallenged), and the shared probe time budget still bounds the run. At 8/10 a typical app naming 20 to 40 tables could never pass. The new numbers are on the rule page and in the probe table in docs/configuration/security.mdx. (The AC asks for the reason in the issue before closing; I cannot comment, so it is recorded here for the conductor to post.)
  • Counts: the not-checked message now reads X of N table probe(s) got a definite answer and Y were left unchecked, and every result's details carry tablesPlanned, tablesChecked and tablesUnchecked.
  • Fail that was cut short: a fail from a throttled, capped, out-of-budget or errored run adds The list may be incomplete: X of N table probe(s) got a definite answer and Y were left unchecked (<reasons>). A complete fail is unchanged.

Acceptance criteria

  • Deterministic, documented order; same site twice probes the same tables: past the cap, the first tables in code-unit name order are kept..., discovery is the same whatever order the scripts were fetched in, the same site audited twice, its scripts fetched in another order, probes the same tables; rule page "Which tables are probed".
  • Cap raised, new numbers on the rule page and in the security.mdx probe table; reason above.
  • Not-checked result names checked and left counts: table probes are capped across the run..., tables past the per-project cap count as unanswered....
  • Tests pin the order, the cap (the caps are 2 projects, 30 tables per project and 40 probes per audit (#2104) uses literals) and the counts.
  • Fail that was throttled or capped says how many went unchecked: a fail cut short by a 429 says how many tables went unchecked, a fail past the per-project cap says how many tables went unchecked; a complete fail does not.

Mutation check: removing the sorts fails 7 tests; removing the fail suffix fails both new fail tests.

Gates

  • bun test ./packages/rules/tests/supabase-rls.test.ts: 38 pass, 0 fail
  • bun run scripts/test-suites.ts --run rules (CI step): 12554 pass, 24 todo, 0 fail, 408 files
  • docs-rule-pages, docs-category-table, cli docs-sync, late-link-verdicts-2144: 20 pass, 0 fail
  • cd packages/rules && bun run typecheck: clean
  • cd docs && make validate: pass
  • bun scripts/changelog.ts check: OK

Skill

The squirrelscan agent skill does not need a change: the rule id, skip reasons and check names are unchanged; only counts in messages and details are added.

Hold-list (security probe): draft for Opus review.

@nc9
nc9 marked this pull request as ready for review November 20, 2026 23:39
… its caps to 30/40 and counts unchecked tables #2104

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the boat/supabase-rls-cap-2104 branch from cb21fc8 to 85ae893 Compare November 21, 2026 01:10
@nc9
nc9 merged commit ad176ba into main Nov 21, 2026
8 of 15 checks passed
@nc9
nc9 deleted the boat/supabase-rls-cap-2104 branch November 21, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security/supabase-rls: deterministic table order, cap size, and unchecked count when an app names more tables than the cap

1 participant