The threat model
The attacks Sypnia Data is designed against, and what stops each one.
On this page
| Threat | What stops it |
|---|---|
| Guessing passwords, credential stuffing | rate limits per IP and per e-mail, waits that double after 10 failures, CAPTCHA, the breached-password check, and the same answer for unknown e-mails |
| A stolen refresh token | rotation: the next use by either party reveals the theft and ends the session; in cookie mode it is HttpOnly, so page scripts cannot read it |
| A stolen access token | it expires in an hour; machine tokens can be DPoP-bound and are useless without the private key |
| Forged tokens | each project signs with its own Ed25519 key; verification uses the project’s JWKS and the kid |
| Phishing with auth links | redirects only to allowed addresses; links are single-use, stored as hashes, expire in an hour |
| CSRF against cookie sessions | SameSite=Lax, a double-submit CSRF header, and CORS limited to allowed origins |
| A leaked secret key | refused from browsers, stored as a hash, revocable in a click, registered with GitHub secret scanning |
| SQL injection through the Data API | every value is a parameter; tables and columns are checked against the schema before any SQL is built; one statement per request |
| Escalating inside the database | no superuser; the engine’s login has no rights until it takes a role for one transaction; service_role only with a secret key or project:admin |
| Taking a privileged scope you were not given | sql:*, auth:admin and project:admin count on a user’s token only when an admin listed them in app_metadata.scopes; PATs, device approvals and consents asking for more fail with 403 scope_not_allowed; open registration never grants them |
| Reading another project | the host decides the project through the registry, never input; each project has its own database, roles and keys |
| An agent doing too much | scopes, a consent screen, an audit log of every call, and revocation that takes effect at the next refresh |
| Exhausting the service | rate limits, statement timeouts, row caps and a cap on concurrent instances |
Fixed findings
2026-11-17: privileged scopes could be self-granted (critical, fixed before launch).
- What happened. A signed-up user of a project could create a PAT for themselves with
sql:write, or approve the device flow of the built-in CLI client with it. Either way they could run SQL as the project’s owner role. - Where it reached. That held for the
sypniaproject too, whose database holds the Sypnia Cloud control plane. - Exposure. The engine had been live for hours, with no outside users. The only such tokens came from two QA accounts, and none of them ran SQL.
- The fix.
- The entitlement rule above, enforced at issuance and again at every use.
- Account changes need the person’s own session.
- The CLI asks only for non-privileged scopes by default.
- Regression tests cover PATs, the device flow, dynamic registration and authorization code with PKCE.
Out of scope
Your app’s own code, your database server’s security (patches, network, backups when it is yours), and devices of your users that are already compromised.