Threat model
This threat model covers Commitment Desk Inbox as shipped in the Apache-2.0 repository. It applies to the Cloudflare Worker and the self-host Node adapter. It is a starting point for review, not a certification or a substitute for a deployment-specific assessment.
Assets
Section titled “Assets”| Asset | Why it matters |
|---|---|
| Capture payloads | May contain inspection notes, permit details, and property observations |
| Attachment bytes | Photos and documents can contain taxpayer or property information |
| Audit events | Prove who submitted and reviewed a record |
| API keys | Authenticate capture clients; a leaked key permits submissions |
| Reviewer sessions and magic links | Grant access to the tenant inbox |
| Webhook secrets and deliveries | Can disclose capture metadata to an endpoint |
| Exports | Bulk copies of tenant capture data |
| Tenant settings | Control retention and deletion behavior |
Actors and trust boundaries
Section titled “Actors and trust boundaries”- Capture client — holds a tenant API key and submits uploads and captures over HTTPS.
- Reviewer or administrator — uses a browser session cookie from a magic link.
- Webhook receiver — an external endpoint chosen by an administrator.
- Operator — runs the hosted service or a self-host deployment and controls databases, buckets, secrets, backups, and TLS.
- Tenant — a firm or office. Standard hosted tenants share infrastructure but must never see each other’s data.
The application trusts the tenant resolved from an authenticated API key or session. It does not trust client-supplied storage paths, MIME declarations, file contents, parcel identifiers, pagination cursors, or webhook URLs.
Threats and mitigations
Section titled “Threats and mitigations”| Threat | Mitigation |
|---|---|
| Cross-tenant data access | Every repository query is tenant-scoped; cross-tenant reads return 404; contract tests cover isolation |
| API-key theft or replay | Keys are hashed at rest, shown once, prefixed, revocable, and limited by rate limits; TLS required |
| Session theft or CSRF | HTTP-only SameSite=Lax cookies, Secure in production, same-origin checks on cookie state changes, hashed session tokens |
| Magic-link abuse | Single-use, short-lived, hashed tokens; responses do not reveal account existence; rate limits |
| Email delivery compromise | Worker uses the keyless send_email binding; Node API token is scoped to Email Sending and stored as a secret; failures log codes only |
| Malicious upload | Size limits, allowed-type list, magic-byte checks, malware-scanner hook, hashed originals, no execution path |
| MIME spoofing | Declared content type must match detected JPEG/PNG/WebP/HEIC/PDF signatures |
| Abuse or denial of service | Persisted fixed-window limits on magic links, capture submission, and upload creation; request size limits |
| Stored XSS through capture data | Web app renders text rather than HTML; payloads are untrusted data |
| Webhook spoofing | HMAC-SHA256 signature over timestamp and body; receivers should reject stale timestamps and reuse |
| Webhook secret disclosure | Secret returned once at creation, never in list or delivery history; database encryption recommended |
| Retention or deletion mistakes | Admin-only settings and deletion; soft-delete keeps audit events; evidence objects are removed; backup retention is an operator decision |
| Export leakage | Session-only export, tenant-scoped, no-store response, deleted captures excluded |
| Secret leakage in the repository | CI gitleaks full-history scan; secrets belong in environment or secret managers |
| Dependency compromise | Production audit and license checks; pinned lockfile; review new dependencies |
| Log leakage | Do not log payloads or attachment contents; tenant identifiers only in operational logs |
Residual risks
Section titled “Residual risks”- A tenant administrator can create a webhook to an endpoint they control; that endpoint receives capture metadata by design.
- Soft deletion keeps capture payload metadata so the audit trail remains interpretable. Evidence bytes are deleted, but a stricter purge is a future policy.
- The malware scanner is a hook. Deployments that leave it unconfigured rely on MIME/size checks alone.
- The hosted standard tier shares a database and bucket. Dedicated managed or self-host tiers are the answer for stricter isolation or data residency.
- Self-host operators own TLS, backups, patching, key management, and database encryption.
Hosted versus self-host responsibility
Section titled “Hosted versus self-host responsibility”| Control | Hosted standard | Self-host |
|---|---|---|
| Application rate limits, auth, tenant scoping | Commitment Desk | Commitment Desk code |
| TLS and DNS | Commitment Desk | Operator |
| Database and bucket encryption | Commitment Desk | Operator |
| Backups and restore testing | Commitment Desk | Operator |
| Dependency and application patching | Commitment Desk releases | Operator deploys releases |
| Malware scanner endpoint | Commitment Desk | Operator configures |
| Incident response | Commitment Desk | Operator |
Before accepting real taxpayer data, the operator should complete a deployment-specific review, configure backups and restore testing, define retention, enable a malware scanner, protect administrative accounts with strong authentication, and confirm contractual and insurance requirements.
Organization access
Section titled “Organization access”Reviewer sessions resolve the active tenant from an active membership on every tenant-scoped request. The configured hostname defines the application origin. Switching changes the session’s selected tenant and clears the web query cache. Deactivation clears affected sessions’ current selection atomically with the membership write. Adding an existing user, changing a role, and deactivating access require an administrator in the selected organization. A tenant-scoped audit event records each accepted change.