Skip to content
MyAppBuilder
StableGuide

Security model

Hiding a component does not secure data. Security is enforced server-side. This page explains what that means in MyAppBuilder so you can design your app with confidence.

Security model

Hiding a component does not secure data. Security is enforced server-side. This page explains what that means in MyAppBuilder so you can design your app with confidence.

The principle

Everything a visitor's browser receives — pages, components, records, API results — has already been filtered by the server according to that visitor's role and identity. Rules you set in the builder are not hints for the interface; they are checks the server performs on every request. A visitor who edits their browser, replays requests or guesses URLs still only gets what their role allows.

What the server filters before sending your app

For every visitor, the server builds a personal copy of the configuration (configForUser):

  • Pages the role cannot open are reduced to a stub (so the app can redirect to sign-in instead of showing Not found); their components are removed.
  • Components restricted with the Permissions tab are removed, together with everything inside them.
  • Server-only details are stripped from every app: API URLs, headers, query parameters, bodies and authentication; data source connection settings; environment variables; the steps of workflows (only name, trigger and on/off remain); reusable component definitions.

What the server checks on every data request

  • Entity operations (view, create, edit, delete) for the role.
  • Record scope ("own records" and custom filters), for reads and writes; a write may not move a record outside the user's scope.
  • Hidden fields removed from responses; read-only fields removed from writes.
  • Field validation (types, required, unique, options, relations).
  • Tenancy: every record carries the app id and the data environment (test or live); queries always filter on both, so apps cannot see each other's data and test data never mixes with live data.

What the server checks for actions

Server actions run by reference: the browser sends which component/event/action to run, not what it does. The server locates the action in the visitor's filtered configuration and runs it with the visitor's permissions. Anonymous visitors cannot email arbitrary addresses, and uploads, record creation and API calls are rate-limited.

What stays in the browser (and is not security)

  • Visibility rules (Show only when …): display logic. The component is still delivered.
  • Navigation menus: hidden pages are not links, but protection comes from page access.
  • App and page state: visitors can change it; never treat state as proof of anything.
  • Client-side validation: convenience; the server validates again.

Secrets and credentials

API keys, database connection strings and the email provider key are stored encrypted and exist only on the server. The project definition only records that a secret is configured. Secrets are injected into API requests server-side and never appear in the browser, in exports or in AI prompts. Put credentials in Settings → Environment & secrets, never in a header value or URL.

Other protections you get by default

  • App sessions are 30-day, hashed, httpOnly cookies; passwords are hashed; sign-in endpoints are rate-limited and never reveal whether an email exists.
  • Outgoing requests (APIs, webhooks, data sources) only go to public hosts (private networks and localhost are blocked on production servers), with redirect checks and a 2 MB response cap.
  • Uploads are type-checked by content, size-limited, and SVGs are sanitised; files are served with safe headers.
  • The HTML component is sanitised; templates are plain lookups, never executed code.

Designing securely: a checklist

  1. Give customers and public visitors nothing by default, then grant exactly what each screen needs.
  2. Scope customer data with "own records" rules.
  3. Protect pages and entities, not one or the other.
  4. Use the Permissions tab, not Visibility, for role-based content.
  5. Keep secrets in Environment & secrets and turn off Allow calling from the app for APIs that only workflows should use.
  6. Preview as every role before publishing.

Advanced

See docs/SECURITY.md in the repository for the full description: src/core/permissions/index.ts (entityAccess, recordAllowed, canAccessPage, canSeeComponent, configForUser, stripServerOnly), src/server/data/records.ts, src/server/runtime/actions.ts, src/server/net.ts (SSRF guard) and src/server/storage.ts (upload validation).

Related

Was this helpful?