Luxel threat model (3)
| Threat | Mitigation | Test |
|---|---|---|
| An agent's JSON that injects markup, events outside the contract, unbounded lists, lower data class | Closed grammar and policies before projection; untrusted text only in data of diagnostics | sprint7.test.mjs, the surface fuzz target |
| A malformed surface that crashes the checker | Every field type-checked (a numeric bind crashed before Sprint 11) | fuzz-regressions.test.mjs |
5.7 Supply chain
| Threat | Mitigation | Evidence |
|---|---|---|
| A compromised runtime dependency | The runtime has no third-party dependency | docs/security/dependency-audit.md |
| Known vulnerabilities | npm audit: 0 at every severity (Sprint 12) | same |
| Tampered packages | Lockfiles with integrity for every entry; the provenance's SBOM | same, ADR-048 |
| Secrets in the history | Scanned (gitleaks, trufflehog) | docs/security/secret-scan.md |
5.8 Identity from a trusted gateway (Sprint 13.5, ADR-065)
Only with identity.mode: "gateway-jwt". The gateway (Envoy Gateway, oauth2-proxy, Cloudflare Access) signs the person in and forwards a JWT of the identity provider; luxel-host verifies it on every request that uses a session.
| Threat | Mitigation | Test |
|---|---|---|
| Forged identity headers (X-User-*, X-Actor, X-Forwarded-User…) | Never read; without a token they are logged by family, never by value | tests/security/s13-5-gateway-id.test.mjs |
| alg: none, HS256 signed with the public key, an algorithm not allowed | An allowed list of asymmetric algorithms; none/HS\* refused in the configuration; symmetric keys never loaded | jwt.test.ts, SEC-GATEWAY-ID |
| A token signed by another key, an unknown kid, a key injected through jku/x5u/jwk | Keys only from the configured JWKS URL, by kid, of the type the algorithm needs | jwt.test.ts, SEC-GATEWAY-ID |
| A token of another client of the same provider (Keycloak aud: account) | azp and/or aud required by the configuration | SEC-GATEWAY-ID |
| An expired or not-yet-valid token | exp, nbf, iat with a bounded skew; the session closes | SEC-GATEWAY-ID, H-GATEWAY-ID |
| A stolen session cookie, with the thief's own token or with none | The session is bound to the token's subject: another subject's token or no token ends it | SEC-GATEWAY-ID, H-GATEWAY-ID |
| A provider outage or a tampered key set fetch | Fail closed: from a failed fetch until one works, every token is denied (503), cached ones included; https in production; redirects not followed; the body bounded as it streams; a bounded refresh on an unknown kid | SEC-GATEWAY-ID, jwt.test.ts, identity-hardening.test.ts |
| A provider outage used to end sessions (a malformed token, an algorithm not allowed, two token fields, no token) | During an outage nothing is judged: the same generic 503, no session touched | identity-outage.test.ts, SEC-GATEWAY-ID |
| A cached verification reused after a key rotation under the same kid; a key set read in part; a duplicated kid; malformed UTF-8 in a token | A cache hit needs the very key that verified; a set over 32 keys refused whole; a kid named twice trusted for no key; a fatal UTF-8 decoder | jwt.test.ts |
| An event in flight acting after its session ended or its token expired | The session is checked again after the body is read, before dispatch, and inside the event's transaction right before the handler (adapters of @luxel-framework/server; a hand-written adapter that skips sessionLive keeps a window: GAPS) | SEC-GATEWAY-ID (concurrent), identity.test.ts, server.test.ts |
| Verification or session opening driven by requests the host refuses anyway | Route (well-formed manifest addresses only), every header-only event refusal, Origin/CSRF header and address bucket before verification; events never open sessions; bounded caches evict in constant time | SEC-GATEWAY-ID |
| Two subjects sharing a binding (lone surrogates); a required claim met by an inherited property; two token header fields | Malformed subjects refused; own properties only; raw header fields counted | identity-hardening.test.ts, SEC-GATEWAY-ID |
| A token, a claim value, a path or a store's error in a log line or a page | Never logged or written; refusals are generic; a gate failure is logged with a fixed reason only (no path, no exception message); luxel build refuses a jwksUrl with credentials, a query or a fragment, and writes only known identity fields | SEC-GATEWAY-ID, identity-config.test.ts |
Not protected: a request that reaches luxel-host directly with a valid token for the client (route all traffic through the gateway); revocation inside a token's lifetime; the gateway's own session and sign-out.
6. What Luxel does NOT protect
- Data from whoever controls the browser. A user (or malware on their machine) can read and send everything their own page can. Templates, tokens and the absence of app code are not protection.
- Weak authentication in the app. Password storage, the second factor and the account recovery belong to the app's handlers and backend. Luxel gives the hooks (signIn, accountLimit: 'handler'), not the policy.
- The app's authorization rules. Luxel enforces the roles and scopes the app declares. A wrong scope function is the app's bug.
- Enumeration through the app's handler. The framework cannot make an arbitrary handler answer the same way.
- A compromised host or operator. Provenance proves what starts. It does not protect a running process from whoever controls it.
- Denial of service by volume. The rate limits and bounds keep each request's cost small. A flood is the network's and the balancer's problem.
- The TLS terminator, HSTS, the balancer, backups.
- Old browsers without Fetch Metadata on static forms. They are refused. Use a non-static sign-in.
7. Assumptions
- TLS terminates in front of luxel-host, and the host is reachable only through it (LUXEL_TRUST_PROXY lists that proxy's addresses; a request from any other peer keeps its socket address).
- The signing key never reaches a host. View keys are 32+ random bytes from a secret store.
- The app's handlers, bindings and their own modules are trusted code, deployed with the build. The handlers bundle, the bindings and the app's own server modules are covered by the provenance (RT-8); since Sprint 12 the installed production dependencies are hashed file by file too (S12-6).
- PostgreSQL and the other shared stores are reachable only by the hosts.