Fix guides

In PocketBase, an empty rule means everyone.

Updated 2026-10-14 · Plain English, written for founders who built with Lovable, Bolt, Cursor or similar.

Every PocketBase collection has five API rules: List/Search, View, Create, Update and Delete. Each one can be in one of three states, and the difference between two of them is easy to miss:

So clearing a rule box in the dashboard does not remove access. It opens that action to the whole internet. An empty List rule on a users, orders or messages collection lets anyone page through every record; an empty Update or Delete rule lets anyone change or remove them.

Check from the outside

This is what a stranger does. Open your live app, open DevTools, and search the loaded JavaScript for new PocketBase( to find your server URL, and for .collection( to find collection names. Then list one record without logging in:

curl "https://api.yourapp.com/api/collections/orders/records?perPage=1"

This only tests listing. Open the collection in the dashboard to see the View, Create, Update and Delete rules too.

Only do this against your own server.

Fix it in the dashboard

Open the collection, click the settings (gear) icon, and go to API Rules. For a collection where each record belongs to one user through a user relation field:

List/Search:  @request.auth.id != "" && user = @request.auth.id
View:         @request.auth.id != "" && user = @request.auth.id
Create:       @request.auth.id != "" && @request.body.user = @request.auth.id
Update:       @request.auth.id != "" && user = @request.auth.id && @request.body.user:isset = false
Delete:       @request.auth.id != "" && user = @request.auth.id

Fix it in a migration

If you keep your schema in pb_migrations, add a new migration so the fix is in version control and every environment gets it. For PocketBase v0.23 and later:

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
  const orders = app.findCollectionByNameOrId("orders");
  const owner = '@request.auth.id != "" && user = @request.auth.id';

  orders.listRule = owner;
  orders.viewRule = owner;
  orders.createRule = '@request.auth.id != "" && @request.body.user = @request.auth.id';
  orders.updateRule = owner + ' && @request.body.user:isset = false';
  orders.deleteRule = null;   // superusers only

  return app.save(orders);
});

Migrations run in order and the last one to set a rule wins, so an older migration with an empty rule is fine once a newer one replaces it. Make sure the newer one is deployed.

What SecureIndie checks

After the fix

Check your app

SecureIndie looks for this mistake. The free quick check covers the basics from outside (exposed files, keys in your site's code, headers) in about a minute. Database rules, payment webhooks and AI endpoints need the full audit, which also reads your code and proves what a visitor can actually reach.

Questions

Why is an empty rule public instead of locked?

PocketBase uses null (shown with a lock in the dashboard) for superusers only, and an empty string for no restriction at all. Clearing the box looks like removing access but actually grants it.

Does a list rule hide records or block the request?

For listing it works as a filter: records that do not match are left out and the request still succeeds. That is why an owner-only list rule is safe to use on a shared collection.

Can the dashboard login be used from my frontend?

No. Superusers skip every API rule, so a superuser email and password in client code is a full database login. Use a normal auth collection for your app's users.

Related guides

Checks covered: PB-RULES-001, PB-LIVE-002 · If you think data already leaked