Get started

Security

Security is built into the architecture, not added afterwards. This page explains the protections and what operators should do.

Tenant isolation

  • The workspace of a request comes only from trusted sources: the signed-in session (checked against your membership on every request), the API key, or the workspace slug for public content. A workspace id sent by the client is never trusted.
  • Every query is filtered by workspace in the application code.
  • PostgreSQL row-level security is enabled and forced on every workspace table. Even a query that forgot its filter cannot read another workspace's rows. The application connects with a role that is not a superuser and cannot bypass these rules.
  • Relations, media references and unique values are always scoped to one workspace.
  • Automated tests try to read, change and list other workspaces' data on every resource type.

Authentication

  • Passwords are hashed with Argon2id and must be at least 12 characters.
  • Browser sessions use random tokens in httpOnly, SameSite=Lax cookies (Secure in production). Only a hash of each token is stored, so sessions can be revoked instantly.
  • Every state-changing cookie request requires a CSRF token.
  • API keys are shown once and stored only as hashes. They can expire, be revoked, and carry least-privilege scopes.
  • Changing a password signs out all other sessions. Removing a member ends their access immediately.
  • Login and setup are rate limited. First-run setup can be protected with a token.

Authorization

  • Built-in roles (viewer, editor, admin, owner) with a fixed permission matrix, enforced on the server for every request.
  • Field-level rules: fields can require a minimum role to read or write. Hidden fields are removed from responses and cannot be filtered, sorted or expanded.
  • The public API only shows entities, fields and records you explicitly publish.

Input and uploads

  • Every input is validated against the schema on the server, including values returned by plugins.
  • Database queries are fully parameterized. Field names and operators are validated against the schema before they are used.
  • Uploads are limited to an allow-list of types and checked by their actual content. SVG is rejected. File names are sanitized, storage keys are generated, and downloads are served with a sandboxing Content-Security-Policy.
  • Request bodies, page sizes, filters and expansions have hard limits.

Privacy in logs and audit

  • Logs never contain request bodies, query strings, credentials or tokens.
  • The audit log records which fields changed, never their values.

Operator checklist

  • ☐ Serve only over HTTPS, and keep COOKIE_SECURE=true.
  • ☐ Set a strong SETUP_TOKEN until setup is complete.
  • ☐ Expose only the reverse proxy. Keep the API and PostgreSQL on a private network.
  • ☐ Use unique, generated passwords for POSTGRES_PASSWORD and APP_DB_PASSWORD.
  • ☐ Never give the application role superuser or BYPASSRLS rights.
  • ☐ Give API keys only the scopes they need, with expiry dates, and never put them in browser code.
  • ☐ Install only plugins you have reviewed.
  • ☐ Back up daily, encrypt backups, and test restores.
  • ☐ Keep dependencies and images updated. CI runs pnpm audit.

Known limitations

  • Rate-limit counters are kept in memory, which suits one API instance. Several instances need a shared store.
  • Multi-factor authentication and single sign-on are not available yet.

Reporting a vulnerability

Please report security issues privately to the maintainers through the repository's security advisory feature instead of a public issue.

ByteContent by ByteRings is open source under the MIT License. Edit on GitHub