Threat model

This model covers the Clank framework, generated authenticated applications, CLI, control plane, deployment artifact path, managed ingress, service drivers, and backup system.

6 min read1,146 wordsClank 0.7.0

This model covers the Clank framework, generated authenticated applications, CLI, control plane, deployment artifact path, managed ingress, service drivers, and backup system.

Assets

  • account credentials, sessions, passkeys, recovery tokens, and CLI tokens;
  • organization membership, project permissions, audit history, and deployment authority;
  • application source/artifacts, migrations, secrets, databases, files, email, jobs, and webhooks;
  • control-plane master keys, encrypted backups, release history, and signing/provenance data;
  • availability and integrity of active application processes and routes.

Principals

  • anonymous browser or agent;
  • authenticated application user;
  • organization owner, admin, developer, or viewer;
  • allowlisted control-plane platform administrator;
  • browser account approving a CLI device;
  • account-wide or project-scoped CLI token;
  • deployment control-plane process;
  • authenticated deployment worker;
  • deployed application process/container;
  • machine, container, database, DNS, email, object-storage, and TLS operators.

Trust boundaries

  1. Browser/agent to application HTTP and live-stream APIs.
  2. Browser to auth, recovery, MFA, and passkey ceremonies.
  3. CLI to browser-approved device flow and control-plane bearer API.
  4. Artifact bytes to extraction, migration, candidate startup, and activation.
  5. Control plane to application process/container and project filesystem.
  6. Managed ingress to host routing and application upstream.
  7. Framework to external email, file, job, webhook, database, and provisioning providers.
  8. Live database to encrypted backup repository and restore target.
  9. Git source to CI, attestation, GitHub release, and npm publication.
  10. Trusted application source through the TSX compiler to generated executable modules.

Primary abuse cases

ThreatRepresentative attackPrincipal controlsResidual responsibility
Account takeoverCredential stuffing, reset replay, stolen session, cloned authenticatorScrypt, generic login errors, shared HMAC-keyed control-plane rate limits, single-use recovery, MFA, WebAuthn verification/counters, revocationUpstream abuse controls, bot defense, email security, user/device risk policy
Cross-site actionCSRF, forged Origin, cross-site device approvalStrict cookies, CSRF token, Fetch Metadata/origin checksCorrect proxy scheme/host configuration and CSP
Tenant escapeGuess project/user IDs, reuse scoped token, stale membershipOwned SQL, membership/role checks, project/scope checks on every request, revocationDomain-specific row/resource authorization
Privilege escalationAdmin grants excess scopes, removes last owner, uses viewer token to deployRole matrix, scope intersection, last-owner protection, auditPeriodic access review and separation of duties
Platform-admin abuseWorkspace admin assumes global authority, stolen CLI token lists tenants, stale allowlist retains accessSeparate operator role, exact startup reconciliation, browser-only global APIs, same-origin sessions, bounded redacted directoryProtect operator email accounts, require strong authenticators, review the allowlist and global audit trail
Impersonation abuseOperator silently edits tenant data, targets another operator, replays a support token, or denies accessing an accountRecent-auth and CSRF gate, exact target confirmation, required reason, admin/self/disabled-target denial, hashed 15-minute session-bound capability, safe-method-only effective identity, visible banner, real-actor start/stop auditLimit the operator allowlist, alert on support sessions, require ticket-linked reasons and customer approval where policy or law requires it
Invitation replay or disclosureReuse a superseded token, create an uninvited account while signup is closed, scrape pending addresses or audit metadata, flood active invitationsHashed email-bound single-use account-creation capability, pre-hash origin check, transactional consume/membership, failed-account cleanup, atomic replacement/revocation, administrator-only pending metadata, developer audit redaction, 100-active cap, auditDeliver tokens through a trusted channel and protect invited mailboxes
Artifact compromiseTraversal, symlink, decompression bomb, digest swap, malicious install hookBounded deterministic bundle, path/type/mode validation, SHA-256 verification, no remote install/build hooksReview trusted source and isolate runtime execution
Migration/data lossEdited history, unsafe SQL, failed migration, destructive rollbackImmutable ledger, restricted SQL, quiesced backup, transactional apply, safety restore, confirmationSchema review, off-host backups, restore drills
Secret disclosureAPI response/log leak, filesystem exposure, package publicationAES-GCM, no secret reads, recursive log redaction, private umask, npm package auditKMS, rotation, OS/operator access, provider logging
SSRF/proxy confusionAttacker-chosen upstream, scheme-relative path, duplicate host, hop-header smugglingLoopback/allowlist upstreams, target origin assigned before path, exact unique hosts, Connection-nominated header stripping, manual redirectsNetwork egress policy and trusted DNS/TLS edge
Domain/certificate takeoverReassign pending hostname, spoof TXT, route elsewhere, trigger certificates for arbitrary SNIExact random TXT proof, immutable cross-project assignment, separate routing state, reserved namespaces, indexed TLS allow check restricted to deployed sitesPrivate edge link, CAA/ACME policy, certificate storage and CA monitoring
Worker split brainExpired worker completes after reassignmentAuthenticated leases, monotonic fences, idempotent durable operationsHighly available backing store and supervisor integration
Backup tampering or omissionCiphertext/manifest alteration, duplicate schedulers, missed recovery point, restore wrong copyAES-GCM envelope, manifest HMAC/AAD, digest/integrity checks, durable leased scheduling, bounded retention, explicit confirmationMonitoring, separate key custody, off-host replication, restore drills
Destructive project actionStolen scoped token, developer error, path substitution, partial site deletionOwner/admin account principal, scoped-token denial, CSRF, exact slug confirmation, separate data-loss acknowledgement, durable lock, derived symlink-safe paths, token revocation, retained audit eventAccount-token protection, off-platform copy deletion, legal retention policy, deletion drills
Audit repudiation or tenant disclosureHide a destructive event, read another workspace, reuse stale elevated scopeNon-cascading organization attribution, current membership/role joins, project-token intersection, bounded cursor pagination, no audit mutation API, deleted-target retentionTrusted SQLite admins can alter local rows; replicate or sign events independently when operator tampering is in scope
Supply-chain compromiseMutable CI action, leaked npm token, package includes local stateCommit-pinned actions, least privilege, OIDC trusted publishing, attestation, package allowlist, zero dependenciesGitHub/npm account security and protected release environment
Compiler boundary confusionTreat attacker-controlled data as TSX source or assume generated code is sandboxedCompiler accepts project source only, performs no build-time evaluation, and emits reviewable modulesNever compile request/database values; isolate mutually untrusted app execution
Denial of serviceChunked oversized request, CBOR/artifact bomb, repeated retained releases, scrypt/device-code exhaustion, high-cardinality limiter keys, failing upstream, unbounded metric labels, site/domain exhaustionStreaming byte/count/time bounds, CBOR depth/collection limits, per-project artifact count/byte ceilings, password queue, bounded durable rate-limit state, circuits, transactional quotas, fixed-cardinality metrics, leases/retriesEdge rate limits, whole-volume monitoring, compute quotas, autoscaling, capacity planning

Explicit assumptions

  • The operating-system administrator and master-key holder are trusted.
  • The process runner executes trusted applications. Use Docker or stronger isolation for mutually untrusted deployers.
  • TypeScript and TSX files are trusted executable application source. The compiler is not a sanitizer for attacker-controlled data.
  • TLS termination, certificate/key custody, ACME issuer policy, DDoS protection, WAF rules, and public network policy are external to the core package. Clank only decides hostname eligibility.
  • An application process can read its own decrypted environment and database.
  • SQLite is a strong single-node transactional default, not a globally replicated database.
  • External drivers are trusted only to the authority represented by their narrowly scoped token and endpoint.

Review triggers

Repeat this threat review when adding a credential type, raw HTML path, file parser, public protocol, proxy rule, external provider, database engine, runner, multi-node coordinator, privileged role, destructive action, or release channel.