Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/0001_unindexed_foreign_keys.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

Level: INFO
**Level:** INFO

**Summary:** Unindexed foreign keys

**Ramification:** Database queries that filter or join on these columns will be slower because there is no index to speed them up.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0002_auth_users_exposed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** User data exposed through a view

**Ramification:** A view is exposing your users' personal information to anyone who can access your API.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0003_auth_rls_initplan.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Slow security policy detected

**Ramification:** A security policy is running its check on every single row instead of once per query, which slows down your database as your tables grow.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0004_no_primary_key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: INFO
**Level:** INFO

**Summary:** Table has no primary key

**Ramification:** Without a primary key, rows can't be uniquely identified, which can cause data issues and slower queries.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0005_unused_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: INFO
**Level:** INFO

**Summary:** Unused index found

**Ramification:** This index is never used by any query but still slows down every insert, update, and delete on the table.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0006_multiple_permissive_policies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Multiple permissive policies on a table

**Ramification:** When several permissive policies exist on one table, access can become broader than intended and queries slower.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0007_policy_exists_rls_disabled.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: INFO
**Level:** INFO

**Summary:** Security policy not enforced

**Ramification:** A security policy exists but has no effect because Row-Level Security hasn't been turned on for the table.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0008_rls_enabled_no_policy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: INFO
**Level:** INFO

**Summary:** No access rules defined

**Ramification:** Row-Level Security is enabled but no policies exist, so no data can be read or written through the API.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0009_duplicate_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Duplicate index found

**Ramification:** Identical indexes on the same table waste storage and slow down writes with no performance benefit.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0010_security_definer_view.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** View bypasses row-level security

**Ramification:** A view in the public schema runs with elevated privileges and ignores Row-Level Security, which could expose more data through the API than intended.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0011_function_search_path_mutable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Unsecured function search path

**Ramification:** Without a fixed search path, this function could behave unpredictably or be exploited to reference unintended database objects.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0012_auth_allow_anonymous_sign_ins.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: INFO
**Level:** INFO

**Summary:** Anonymous sign-ins enabled

**Ramification:** Anonymous users share the same database role as permanent users, so existing security policies may unintentionally grant them access.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0013_rls_disabled_in_public.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** Table publicly accessible

**Ramification:** Anyone with your project URL can read, edit, and delete all data in this table because Row-Level Security is not enabled.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0014_extension_in_public.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Extension installed in public schema

**Ramification:** The extension's internal functions and tables are visible in your API, cluttering it and potentially exposing unintended functionality.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0015_rls_references_user_metadata.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** Security policy relies on user-editable data

**Ramification:** A security policy references user_metadata, which end users can freely modify, allowing them to bypass access controls.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0016_materialized_view_in_api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: WARN
**Level:** WARN

**Summary:** Materialized view exposed in API

**Ramification:** Materialized views can't be protected by Row-Level Security, so all their data is visible to every API user.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0017_foreign_table_in_api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: WARN
**Level:** WARN

**Summary:** Foreign table exposed in API

**Ramification:** Foreign tables can't be protected by Row-Level Security, so all their data is visible to every API user.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0018_unsupported_reg_types.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: WARN
**Level:** WARN

**Summary:** Column type blocks Postgres upgrades

**Ramification:** A table uses a Postgres internal type that is not supported by pg_upgrade, which will prevent you from upgrading to future Postgres versions.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0019_insecure_queue_exposed_in_api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** Queue exposed without protection

**Ramification:** Anyone with your project URL can read, modify, and delete messages in this queue because it lacks access controls.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0020_table_bloat.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: WARN
**Level:** WARN

**Summary:** Excess table bloat detected

**Ramification:** The table has accumulated significant unused space from old row versions, which increases storage costs and slows down queries.

---

### Rationale
In PostgreSQL, bloat occurs when tables contain extra, unused space due to deleted or updated rows. PostgreSQL doesn’t immediately reclaim the space used by these rows but instead marks it as reusable for future operations. Over time, if this space isn’t efficiently reused, the table becomes bloated, meaning it takes up more storage than necessary, slowing down database performance and increasing I/O overhead.
Expand Down
8 changes: 7 additions & 1 deletion docs/0021_fkey_to_auth_unique.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: ERROR
**Level:** ERROR

**Summary:** Foreign key blocks Auth upgrades

**Ramification:** A foreign key references a constraint in the auth schema that is scheduled for removal, which will prevent future Auth updates and security patches.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0022_extension_versions_outdated.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Level: WARN
**Level:** WARN

**Summary:** Extension out of date

**Ramification:** An installed extension is running an older version that may be missing security patches and is not covered by the Supabase SLA.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0023_sensitive_columns_exposed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: ERROR
**Level:** ERROR

**Summary:** Sensitive data publicly accessible

**Ramification:** A table with columns that likely contain sensitive data (like passwords or personal identifiers) is accessible through the API without any access restrictions.

---

### Rationale

Expand Down
8 changes: 7 additions & 1 deletion docs/0024_permissive_rls_policy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

Level: WARN
**Level:** WARN

**Summary:** Security policy allows unrestricted access

**Ramification:** An RLS policy uses an always-true condition like `USING (true)`, which defeats the purpose of having Row-Level Security enabled.

---

### Rationale

Expand Down
10 changes: 10 additions & 0 deletions mkdocs.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lints were missing from the nav. This adds them in.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@ nav:
- Duplicate Index: '0009_duplicate_index.md'
- Security Definer View: '0010_security_definer_view.md'
- Function Search Path Mutable: '0011_function_search_path_mutable.md'
- Auth Allow Anonymous Sign-ins: '0012_auth_allow_anonymous_sign_ins.md'
- RLS Disabled in Public: '0013_rls_disabled_in_public.md'
- Extension in Public: '0014_extension_in_public.md'
- RLS References user_metadata: '0015_rls_references_user_metadata.md'
- Materialized View in API: '0016_materialized_view_in_api.md'
- Foreign Table in API: '0017_foreign_table_in_api.md'
- Unsupported reg Types: '0018_unsupported_reg_types.md'
- Insecure Queue Exposed in API: '0019_insecure_queue_exposed_in_api.md'
- Table Bloat: '0020_table_bloat.md'
- Fkey to Auth Unique: '0021_fkey_to_auth_unique.md'
- Extension Versions Outdated: '0022_extension_versions_outdated.md'
- Sensitive Columns Exposed: '0023_sensitive_columns_exposed.md'
- Permissive RLS Policy: '0024_permissive_rls_policy.md'

theme:
name: 'material'
Expand Down