Skip to content

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

Description

@nc9

security/supabase-rls (#1883) probes at most 2 Supabase projects, 8 tables per project and 10 requests per audit. Since #1883's fix round, a run that leaves any named table unchecked is reported as not checked rather than a pass. Most real Supabase apps name more than 10 tables in their client code, so the rule can find an open table among the first few it checks but can never report such a site clean.

Questions to settle:

  • Which tables are checked first when the code names more than the cap allows. Today the order is not documented and may depend on script discovery order.
  • Whether the cap should rise for this rule. The probes are HEAD requests with no body read, and probing already stops on a throttle or challenge response (isThrottledOrChallenged).
  • Whether the not-checked result says how many tables were left unchecked, so a user can tell "2 of 40 checked" from "39 of 40 checked".

Related: #2103 (waiving an intentionally public table by bare name).

Acceptance Criteria

  • When more tables are named than the cap allows, the tables probed are chosen by a deterministic, documented order, stated on the rule page, and the same site audited twice probes the same tables.

  • The cap for this rule is either raised (with the new numbers on the rule page and in the probe table in docs/configuration/security.mdx) or kept, with the reason written in the issue before closing.

  • A not-checked result names how many tables were checked and how many were left, in the message or details.

  • Tests pin the order, the cap, and the checked/left counts in the not-checked result.

  • A fail that was also throttled or capped says in its message how many tables went unchecked, so a reader knows the fail list may be incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions