Luxel threat model (2)
| Threat | Mitigation | Test |
|---|---|---|
| Brute force on sign-in | Per-address and per-account limits (global with a shared limiter) | SEC-S10 |
| Account lockout by others | `accountLimit: delay | handler` (the app may add a second factor) |
| User enumeration | The app's handler answers one message for an unknown user and a wrong password and does the same work; the template does | SEC-S10 (the template) |
| Cost DoS (expensive events) | Size limit, rows per request, pages bounded, rate limit per session and address | sprint7.test.mjs (limits) |
| Floods of page and state loads | Every load takes a rate-limit token per session or address, global over nodes with the shared limiter (Sprint 12, RT-6) | s12-debt.test.mjs, tests/cluster/production.test.mjs |
| Look-alike names (zero-width or compatibility characters) | views.‹id>.normalize per input; identity inputs NFKC by default; zero-width and control characters removed before the limits and the handler (Sprint 12, RT-13) | s12-debt.test.mjs |
| A forged Host (DNS rebinding, Host-based cache poisoning) | LUXEL_HOSTS, required in production: any other Host gets 421 before anything runs (Sprint 12) | s12-debt.test.mjs |
5.2 Pages and the projector
| Threat | Mitigation | Test |
|---|---|---|
| XSS through data | Slots are filled only with escaped text by slot kind; no slot may hold an id, a name, a style, an on* attribute, a URL, srcdoc, formaction (compile-time refusal); since Sprint 12 every template, item part and number-list child is parsed (parse5) and checked against allowlists of what the compiler writes, at build, in luxel check and at host start (ADR-054); the state is validated before filling | slots-projector.test.mjs, mxss.test.mjs, markup-structural.test.mjs, markup-diff.test.mjs (differential against Chromium, Firefox and WebKit), forbidden-slots corpus, the projector fuzz target |
| A link to another site, a javascript: address or an open redirect through a link | ‹Link to> compiles to ‹a href="‹view id>">, fixed at build time and checked against the app's routes (LUXEL-E059); no slot can write href; the structural check accepts href on ‹a> only and only a view id (no scheme, host, path, query or fragment can match); luxel-host refuses to start when a link names a view it does not serve (Sprint 12.1, ADR-058) | s12-1-link.test.mjs |
| A page of another site signs the user out (CSRF on the sign-out form), or turns the answer into a redirect to another site | ‹Logout> compiles to ‹form method="post" action="/_luxel/logout">, with no token (the template is public). The route accepts a navigation only with Sec-Fetch-Site: same-origin, Sec-Fetch-Dest: document and an Origin that is this origin or null (pages have Referrer-Policy: no-referrer); no Fetch Metadata, no form. The cookie is SameSite=Strict. The answer is 303 to one address fixed at build (LUXEL-E066) and held in the host config: the request's URL, body and headers are never read to make it. A script's request keeps the CSRF header (Sprint 12.3, C15). Residual: one proof less than an event (no token); the effect is limited to ending the session | s12-3-logout.test.mjs, tests/e2e/s12-3-logout.spec.mjs |
| Script injection | CSP with the hashes of the runtime modules and the import map only; require-trusted-types-for 'script'; trusted-types 'none'; the runtime contains no eval, Function, innerHTML or document.write | tests/conformance/capabilities.test.mjs (H-SPEC), lint-rules.mjs |
| A page of one user served to another by a cache | Filled pages, state and answers are no-store with Vary: Cookie; only public files are cacheable | tests/cluster/cache.test.mjs (SEC-CACHE) |
| A static page that shows someone's data | Its load has no session (E056 and run-time guard); the page is part of the signed build | static-review.test.mjs, provenance.test.mjs |
5.3 Runtime (browser)
The runtime is not a security boundary: whoever controls the browser controls it. It must still not make an honest page unsafe.
| Threat | Mitigation | Test |
|---|---|---|
| An answer that injects markup | Answers are decoded with the closed grammar and written with textContent | differential fuzzing, mxss.test.mjs |
| An answer that renames or duplicates an item | An op's state carries no key (fixed in Sprint 11) | fixture f01-item-op-state-with-key |
| Loading a module the page did not declare | A closed list of import specifiers; SRI on the manifest; CSP hashes | tests/conformance/capabilities.test.mjs |
| Data left in browser storage | No storage API in the packages (decision 9) | lint-rules.mjs |
5.4 Build, provenance and deployment
| Threat | Mitigation | Test |
|---|---|---|
| A changed, added or removed file on a host | Production checks the signed provenance before loading anything of the build, then every served byte | provenance.test.mjs, tests/e2e/provenance.spec.mjs |
| A changed file among the installed dependencies (luxel-host's own included) | The provenance hashes every file of the production dependencies; a changed, added or missing one stops the host (Sprint 12, S12-6) | s12-debt.test.mjs |
| A build signed by an unknown or retired key | Only LUXEL_PROVENANCE_KEYS verify; dropping a key stops its builds from starting | incident.test.mjs |
| A compromised build already deployed | luxel revoke ‹digest>: every node of it serves 503 within a poll; its tokens fail elsewhere | provenance.test.mjs |
| Secrets in the public build | The exposure scan and process.env refused in views (E038, E054) | H-EXPOSURE, react-mistakes.test.ts |
| Non-reproducible build (cannot be checked by a third party) | scripts/reproducible-build.mjs; two environments compared, and since Sprint 12 two platforms (darwin-arm64 and linux-x64) byte for byte | Sprint 11 and 12 reports |
5.5 Development server
| Threat | Mitigation | Test |
|---|---|---|
| luxel dev exposed or run in production | Refuses LUXEL_ENV=production; generates a throwaway key; listens on loopback by default | SEC-S10, red team |
| Compiler errors used for XSS in the dev page | Escaped, under a closed CSP | SEC-S10 |