Bubble.io database & security guide: Privacy Rules, Security Dashboard, API keys, and signed webhooks
An engineering guide grounded in official Bubble documentation: database architecture, auditing with Bubble Security Dashboard, API Connector key safety, RBAC, signed webhooks, and running Backend Workflows without Ignore privacy rules.
Database management in Bubble: schema design drives both security and WU
In Bubble.io, database architecture directly determines two critical outcomes: how many Workload Units (WU) every screen consumes and whether you can cleanly enforce Privacy Rules. Official Bubble documentation and experienced Bubble architects emphasize designing your schema alongside Privacy Rules from day one—retrofitting access boundaries onto an existing schema almost always forces painful structural rewrites.
First, separate Data Types, Satellite Data Types, and Option Sets deliberately. Option Sets are compiled into your app’s client-side JavaScript bundle and cached in the browser: they are fast and ideal for static enums (statuses, categories, role names), but Bubble’s manual explicitly warns that Option Sets are unencrypted and fully visible in browser DevTools. Never store secrets, API keys, or sensitive configuration in Option Sets.
Second, keep core tables (such as User or Listing) lightweight. Move bulky, rarely searched fields—long descriptions, raw JSON payloads, or heavy metadata—into linked Satellite Data Types (saddlebag tables) to cut search payload size and WU consumption. Run constraints server-side inside “Do a search for” instead of client-side “:filtered” or “Advanced” expressions on large lists, which force Bubble to ship excess records to the browser.
Third, place direct ownership fields (such as owner, organization, or tenant) directly on every isolated Data Type. Bubble Privacy Rules evaluate fastest and most reliably on direct references (This Order’s Organization is Current User’s Organization) rather than deep nested queries. Finally, if external clients do not need raw table access, keep the Data API disabled under Settings > API.
Privacy Rules: the only true server-side firewall in Bubble
The most common Bubble security mistake is hiding elements conditionally or redirecting users with “Go to page” on “Page is loaded” instead of configuring Privacy Rules. Per Bubble’s official documentation, Privacy Rules are the sole server-side firewall: when a rule denies access, Bubble’s server never transmits those fields to the browser. Without Privacy Rules, anyone can inspect browser DevTools network responses and read hidden records.
Baseline practice for every Data Type: under “Everyone else (default permissions),” uncheck every permission by default—including “View all fields,” “Find this in searches,” “View attached files,” and “Allow auto-binding.” Pay special attention to “Find this in searches”: leaving it checked allows unauthorized users to probe records or extract Unique IDs via searches even when individual fields are hidden.
Do not overlook file privacy: uploaded files in Bubble are publicly accessible via their direct URL by default. To enforce Privacy Rules on files, enable “Make this file private” on the File Uploader and attach each file to a specific database Thing (“Attach this file to”) protected by your Privacy Rules.
Auditing your app with the Bubble Security Dashboard
Bubble provides a built-in auditing suite—the Bubble Security Dashboard (bubble.io/security-dashboard)—to scan elements, workflows, settings, and plugins for exposure risks. According to Bubble’s manual, it centers on four tools: Issues Explorer (surfaces vulnerabilities ranked by severity with remediation guidance), Privacy Rules Checker (evaluates database structure and sample rows for public exposure), Automated Tests (scheduled recurring scans), and Test Settings Customization (scoping scans by branch, public vs. private pages, and data types to cut false positives).
One practical detail from the manual: Privacy Rules Checker requires sample entries inside your Data Types to evaluate field visibility accurately—empty tables will not surface leaks. Basic Security Checks are included across all paid plans (Starter, Growth, Team, Enterprise) and flag missing privacy rules, search privacy gaps, constrainable fields, publicly exposed sensitive fields, weak password policies, unprotected test environments, sensitive data in workflows, and unsafe API configurations. Advanced Security Checks (including secure page protection and deeper database exposure checks) are available on Growth, Team, and Enterprise plans.
Protecting API keys in the API Connector and Settings
In the Bubble API Connector, the “Private” checkbox is the primary control for hiding headers and parameters. When checked, Bubble encrypts and stores the value server-side, excludes it from client source code, and routes the request through Bubble’s server. Unchecking “Private” makes the parameter dynamic so client workflows can populate it—which also means it can be exposed in the browser if misused.
A critical caveat from Bubble’s official documentation that trips up even seasoned builders: if an API collection’s Authentication is set to “None or self-handled,” values marked as “Private” can still be exposed. Whenever an external API requires credentials, configure a proper authentication method (such as “Private key in header,” “Private key in URL,” or OAuth2) rather than relying on “None or self-handled.”
Similarly, guard Bubble Admin API Tokens generated under Settings > API. An app-wide Bearer token authenticates with full administrator privileges and bypasses every Privacy Rule. Reserve it strictly for trusted server-to-server scripts or migrations—never ship it to frontend clients. When external clients need user-scoped API access, authenticate them through a Backend Workflow running “Log the user in” so requests receive a temporary user token bound to that user’s Privacy Rules.
Role checks: building reliable RBAC in Bubble
Model user roles with an Option Set (for example, Role: Admin, Manager, Member) stored on the User type. Crucially, never allow users to edit their own Role field—not via auto-binding and not via a frontend workflow that accepts a role from page state or form inputs. Restrict role mutations strictly to a server-side Backend Workflow that verifies Current User’s Role is Admin.
Enforce role checks at two layers simultaneously: inside Privacy Rules (so restricted data never reaches an unauthorized browser) and inside server-side “Only when” conditions on every sensitive workflow. A “Page is loaded” redirect is a UX convenience, never an authorization boundary.
When to move logic into Backend Workflows for stronger security
Any workflow running on a page is initiated by the user’s browser, where an attacker can inspect payloads, manipulate client state, or attempt out-of-sequence calls. Move operations into Backend Workflows whenever they touch billing status, credits or balances, role changes, server-side pricing calculations, sensitive notifications, external API calls carrying private credentials, or bulk database updates.
For internal workflows triggered only by your own app via “Schedule API Workflow,” leave “Expose as a public API workflow” unchecked. When an endpoint truly must be public, never enable “This workflow can be run without authentication” unless the workflow itself enforces an explicit signature, secret header, or provider callback check.
Receiving signed webhooks in Bubble without spoofing risks
Verifying signed webhooks (such as Stripe’s HMAC-SHA256 signatures) inside Bubble hits a well-documented platform limitation discussed widely on the Bubble Forum. Providers calculate the HMAC over the exact, unmodified raw byte stream of the request body. Bubble’s Backend Workflow JSON parser normalizes and strips whitespace/formatting from incoming payloads before workflow actions see them, causing native HMAC calculations against the re-serialized JSON to mismatch and fail.
Top Bubble engineers rely on two proven production patterns to prevent spoofed webhooks. Pattern 1 (Event ID Verification Lookup—pure Bubble): accept the incoming webhook on a public endpoint, but NEVER trust the payload’s amount, status, or user fields. Instead, read only event.id and immediately make an authenticated server-side API Connector call back to Stripe (GET /v1/events/{id} or GET /v1/checkout/sessions/{id}) using your private Stripe key, then fulfill the order solely from Stripe’s authoritative API response.
Pattern 2 (Lightweight Verification Middleware—strict cryptographic HMAC): point Stripe at a thin serverless endpoint you control (Cloudflare Worker, AWS Lambda, Cloud Run, or Xano) that captures req.rawBody, verifies stripe.webhooks.constructEvent(), and forwards the verified payload to your Bubble Backend Workflow authenticated with a shared secret header or Bearer token. In both patterns, log processed event IDs in your database to guarantee idempotency across webhook retries.
Running Backend Workflows WITHOUT checking “Ignore privacy rules”
Every Backend Workflow includes a tempting checkbox: “Ignore privacy rules when running the workflow.” Checking it elevates that workflow to full administrator privileges across your entire database. Turning it on by default “just to make things work” quietly dismantles your server-side access model.
Per Bubble’s official documentation, when “Ignore privacy rules” is left unchecked, a Backend Workflow scheduled from the frontend automatically executes in the context of the Current User—enforcing that user’s exact Privacy Rules. To keep most Backend Workflows running safely without bypassing rules: (1) pass the target Thing or rely on Current User context rather than unconstrained searches; (2) keep direct access fields (owner, organization, allowed_users) on your Data Types so Privacy Rules resolve cleanly inside backend searches; and (3) authenticate external API callers with user tokens from “Log the user in” rather than an Admin API Token.
Reserve “Ignore privacy rules” strictly for genuine system-level jobs: unauthenticated inbound webhooks, cross-tenant aggregations, scheduled maintenance, or system notifications to other users. In every workflow where it is enabled, gate execution with explicit “Only when” conditions (checking Current User’s role, a secret header, or a verified upstream API response) so the elevated workflow can never be abused.
Sources and further reading
Bubble Security Dashboard (automated security & privacy checks) ↗
Bubble Manual: Protecting data with privacy rules ↗
Bubble Manual: The API Connector & private parameters ↗