Luxel threat model
Status: Sprint 11 (2026-12-01), for VSA 0.9.0 and the packages at the Sprint 11 commit. Written for the external review (docs/security/review-pack/) and the red team (Sprint 11 report). Each mitigation names the test that checks it. This document makes no claim of conformance with OWASP or anything else.
1. What Luxel is, in one paragraph
A TSX view is compiled once into a public template, a slot map and a manifest (docs/spec/compiler-ir.md). Per request, luxel-host fills the template's slots with escaped text from the app's handlers and adds a resume block. The page loads one universal runtime (the same bytes for every app). The runtime resumes the painted page, writes values the server sends and sends events. POST /_luxel/event is the only endpoint that changes anything. The browser computes nothing and decides nothing, and it receives no code of the app (ASEF = 0).
2. Assets
| Asset | Where | Why it matters |
|---|---|---|
| A person's data (balances, records, what they searched) | App database; filled pages; state and event answers | Confidentiality |
| The effect of an action (a payment, a change) | App database, through defineEvent writes | Integrity; exactly once |
| Sessions | Session store (only the hash of the id; the CSRF token is derived) | Whoever holds a session acts as its user |
| View keys (LUXEL_VIEW_KEYS) | Host environment | Mint view and form tokens |
| Signing key (LUXEL_SIGNING_KEY) | Build pipeline only | A build signed with it is accepted by production hosts |
| The build (templates, manifests, runtime, handlers bundle) | Host file system | What every visitor's browser runs and sees |
| Availability of the host and its stores | — | Rate limits, bounded work per request |
3. Actors
| Actor | Capabilities assumed |
|---|---|
| Anonymous Internet user | Any HTTP request, any body, any header except those a browser sets for a third-party page; many addresses (botnets) |
| A malicious web page visited by a signed-in person (CSRF) | Makes the browser send requests with the person's cookies, within what browsers allow cross-site |
| A signed-in user acting against others (IDOR, escalation) | A valid session of their own; full control of their own browser (they can read and send anything the page can) |
| A same-site sibling (another subdomain) | Can set cookies for the parent domain, can make same-site requests |
| An agent producing dynamic surfaces | Writes arbitrary JSON that luxel check judges (ADR-017) |
| Someone with write access to the deployed files, not to the signing key | Changes, adds or removes files on a host |
| A network attacker | Out of scope behind TLS (the session cookie is __Host-…; Secure; TLS is the terminator's) |
| The operator and the host machine | Trusted (see §7) |
4. Trust boundaries
- Browser ↔ luxel-host. Everything from the browser is untrusted: path, headers, cookies, body. The browser receives no secret beyond its own session cookie (HttpOnly) and per-page tokens that are bound to the page.
- luxel-host ↔ app handlers. The gateway decodes and authorizes before a handler runs, and handlers return state paths, never HTML. Handler code is trusted app code.
- luxel-host ↔ stores (sessions, rate limits, replay guard, revocations, the app's database). The stores are trusted and shared between nodes. Keys are hashes.
- Build pipeline ↔ hosts. The build is signed (ed25519). A production host refuses any file that differs from the signed provenance (ADR-048).
- Agent ↔ luxel check. A dynamic surface is untrusted JSON; only what passes the grammar and the policies is projected.
5. Threats and mitigations, by component
5.1 Event endpoint (gateway)
| Threat | Mitigation | Test |
|---|---|---|
| CSRF on a session view | __Host- cookie SameSite=Strict; Origin must be this host; Fetch Metadata (when sent) must be same-origin; X-CSRF-Token derived from the session; custom header Avt and JSON content type force a preflight the gateway never grants | tests/security/matrix.test.mjs, sprint9.test.mjs |
| Login CSRF on a static form | Origin AND Sec-Fetch-Site: same-origin required; Avt + JSON (preflight); single-use form token bound to view and build | sprint10.test.mjs (SEC-S10), red team |
| Session fixation | No session before sign-in (static); sign-in always rotates (new id, old one dropped); __Host- (no Domain) | SEC-S10 |
| Replay of an event | Writes: idempotency key claimed in the same transaction as the effect; reads have no effect (VSA 0.9); form tokens single use | matrix.test.mjs, reads.test.mjs, SEC-S10 |
| Replay of a form token after its nonce left the memory guard | The guard refuses when full instead of evicting (ADR-049) | static-review.test.mjs |
| Token of another view, build, session or key | MAC over view, build (manifest hash + build digest), session binding, key id; expiry | sprint7.test.mjs, provenance.test.mjs |
| IDOR: an id of another user | Every id an event carries (param, select, row column) is re-checked by the app's scope function before the handler runs; another scope answers exactly like a missing id | sprint7.test.mjs, authz-matrix.test.mjs, reads.test.mjs |
| Privilege escalation (role) | Deny by default: every event has a policy; roles checked before the handler | authz-matrix.test.mjs |
| A private view loaded by a role that should not see it | Every view declares load: allow([...]) or load: publicLoad() (LUXEL-E058 otherwise); the roles are checked before every page and state load (Sprint 12, S12-5) | s12-debt.test.mjs |
| Stale writes | State version compared under lock in the write's transaction | matrix.test.mjs |
| A read that writes | No event id; read-only context and connection; LUXEL-E055 at build, and at run time reading a read's event id throws (Sprint 12) | reads.test.mjs, s12-debt.test.mjs |
| Malformed or hostile body | Closed grammar (unknown fields refused), bounded sizes and counts, no prototype keys at any depth, plain text only | wire-fuzz.test.mjs, differential fuzzing (SEC-FUZZ-DIFF) |