From 17f6a178093bda683474f1cf86621fe2e2c69562 Mon Sep 17 00:00:00 2001 From: bchanot Date: Wed, 21 Oct 2026 19:04:14 +0200 Subject: [PATCH] =?UTF-8?q?chore(memory):=20R4.12=20gates=20recorded,=20RU?= =?UTF-8?q?ST.md=20=C2=A710.14=20router=20note=20from=20the=20security=20g?= =?UTF-8?q?ate,=20journal,=20learning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 1 + .claude/memory/learnings.md | 5 +++++ .claude/tasks/TODO.md | 2 +- docs/development/RUST.md | 14 ++++++++------ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 7af09a9c..4d2b0ea2 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -313,3 +313,4 @@ Owner: J2.3 option 1 (current branding on editor export; expected result correct Owner verdict: J1.7 PASS w/ reserve, M3 complementary, J2.3 option 1 final, logo bundle + CSP hardening validated, gitleaks marker valid (writing delegable), 23 R4.8 deletions authorized (21 = census error), Safari iOS real device only → BDR-066, RUST.md §10.11/§10.12 D, recette docs. Contract FILE SCOPE amended (itself, memory, redactions), criteria 9-12 added, none removed. Redacted `/home/` + scratchpad paths in results JSON, contracts, README, history plan; harness now writes repo-relative distDir. LRN-068. Verifier left to orchestrator. No merge, no R5. - 2026-10-21 R4.10 final: check:all green on 8943bf3; verifier CONFORME 12/12 (scope incl. contract itself, floor clean); security PASS (2 LOW: username readable in contract criterion 11 regex; pre-existing gated gitleaks allowlist). Waiting owner Safari iOS J1/J2 + explicit merge signal. No merge, no R5. +- 2026-10-21 R4.12 pre-merge fixes: D3 safeNextPath re-probes rebuilt path (dot segments → //host refused; 5 tests, 3 red on old), D1 worker on distroless static-debian13 (e2e:avatar 5/5), D6 DEPLOY http2 on with nginx 1.24 form kept (1.24 rejects `http2 on`, proven nginx -t). check:all green; verifier CONFORME 9/9; security PASS (fuzz 218, 0 escape). D2/D5 → a11y chantier, D4 → backlog. STOP pre-merge; Safari iOS pending. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index a2748df2..17a23118 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -514,3 +514,8 @@ Apply: when an implementation is swapped under a test that spied the old one, re - R4.10 verifier: 8/8 MET but formal gap: contract's own file in the diff, absent from FILE SCOPE ("memory" written vaguely). Apply: FILE SCOPE names the contract path, each `.claude/memory/*.md` and TODO touched, and gets amended in the same commit as any later scope growth; never drop a CHECK to pass. - `scripts/browser/lib/app-build.mjs` wrote absolute `DIST_DIR` (user home) into committed results JSON from R4.6 on (older runs relative). Apply: any committed report names paths relative to repo or a placeholder; scan `git grep -E "/home/|-home-"` before each report commit. + +## LRN-068b | 2026-10-21 | Runbook syntax fixes need the target's real version; URL sanitiser must re-check its own output + +- Context7 said nginx `listen ... http2` deprecated → `http2 on;`, but live VPS sends `Server: nginx/1.24.0` and 1.24 rejects `http2 on` (`unknown directive`). Apply: before changing a runbook directive, read the target's version (Server header, `nginx -v`) and `nginx -t` both forms in throwaway containers of each version; document both when the fleet straddles. +- WHATWG URL normalisation can create the escape it was meant to catch (`/..//host` → pathname `//host`, same origin for the probe). Apply: sanitiser re-validates the value it returns (not only the input), plus an idempotence test; fuzz with dot segments, `%2e`, tabs inside `..`. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 312d32ff..9c910370 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -294,7 +294,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] R4.12a (51a5a80) D3 `safeNextPath`: the returned value is resolved again against the sentinel origin and must stay same-origin and not start with `//` (dot segments `/..//`, `/%2e%2e//`, `/..\\`, tab inside `..`), else fallback; tests: dot segments, double slashes, backslashes, schemes, encodings, valid destinations unchanged; consumer test through LoginRoute (MemoryRouter) with `next=/..//evil.test` → /app - [x] R4.12b (49b1849; e2e:avatar 5/5 on the new image) D1 worker runtime `gcr.io/distroless/static-debian13:nonroot` (provenance: GoogleContainerTools distroless, cosign-signed; same user 65532, no shell, static); worker:test, worker:image `run --check`, sandbox tests; Dockerfile only - [x] R4.12c (60faac8; nginx 1.24 rejects `http2 on`: both forms documented, nginx -t on 1.24 and 1.31) D6 DEPLOY.md: `listen 443 ssl http2;` → `listen 443 ssl;` + `http2 on;` (nginx ≥ 1.25.1 noted); nothing else in the runbook - - [ ] R4.12d gates: check:all on the final state, pnpm audit --prod, cargo deny, worker tests, navigation suites, goldens/oracles unchanged; contract + fresh verifier + security gate; RUST.md §10.14, CHANGELOG, memory → STOP pre-merge checkpoint + - [x] R4.12d (verifier CONFORME 9/9; security PASS, fuzz 218 inputs 0 escape, 3 LOW; check:all green 18:55:30) gates: check:all on the final state, pnpm audit --prod, cargo deny, worker tests, navigation suites, goldens/oracles unchanged; contract + fresh verifier + security gate; RUST.md §10.14, CHANGELOG, memory → STOP pre-merge checkpoint - [ ] accessibility chantier (owner 2026-10-21, after R4, needs a visual recette): D2 `focus-visible:outline-none` → `outline-hidden` in the 13 files listed in `.claude/audits/CONTEXT7-2026-10-21.md` (keyboard focus, forced-colors, graphic coherence); D5 `` at the root (Dialog scale, ObservationCard height animations, transitions) - [ ] maintenance backlog (owner D4, accepted in principle, not scheduled): apps/app/vitest.config.ts dead `coverage` block (no @vitest/coverage-v8); tests/setup.ts → `@testing-library/jest-dom/vitest`; eslint.config.js `tseslint.config` → `defineConfig`; ui/Input, Select, Textarea `forwardRef` → ref prop (React 19); authStore.ts:95-97 stale deadlock comment; no major upgrade (react-router 8, zod 4, TS 7, vite 8 + vitest 4, ESLint 10, PGlite 0.5 stay out) (`.claude/audits/CONTEXT7-2026-10-21.md`: distroless debian13, Tailwind outline-hidden, safeNextPath dot segments, dead coverage block, jest-dom entry, tseslint defineConfig, forwardRef, DEPLOY http2, reduced motion) → nothing changed until decided - [x] R4.11e checks (rust-check, deny advisories ok, audit --prod clean, app 429, check:all green 17:27:54, goldens untouched, criterion 11 generic; gates dispatched): rust-check, `cargo deny check advisories` clean, `pnpm audit --prod` clean, app suite (routing, auth, redirects), check:all (images, sandbox), goldens and oracles unchanged (git status), contract + fresh verifier + targeted security gate; contract criterion 11 regex made generic (owner §6) diff --git a/docs/development/RUST.md b/docs/development/RUST.md index 5c2243f3..392a2689 100644 --- a/docs/development/RUST.md +++ b/docs/development/RUST.md @@ -2452,12 +2452,14 @@ tab inside `..` into `//evil.test`: same origin for the sentinel, yet a protocol-relative path once returned. The rebuilt value is now refused when it starts with `//` or no longer resolves to the sentinel origin, so the function's contract holds by itself. Consumers (`LoginRoute`, -`RedirectIfSignedIn`, `AuthCallbackRoute`) were not exposed in practice: -react-router 7.18.4's `useNavigate` throws « External navigation is not -allowed » on such a target and `` collapses the slashes -(`resolvePath('//evil.test/app/account')` = `/evil.test/app/account`, a -not-found page), read in the installed package; the fix does not rely on -it. Tests: 4 new `safeNextPath` cases (12 dot-segment spellings, external +`RedirectIfSignedIn`, `AuthCallbackRoute`): with react-router 7.18.4, +`useNavigate` checks the target (« External navigation is not allowed ») +and `` collapses the slashes (`resolvePath('//evil.test/app/account')` += `/evil.test/app/account`), and the old function made the LoginRoute test +fail without leaving the origin. The security gate read one more path in +the installed package: `history.push` falls back to `window.location.assign` +when `pushState` throws. So the router's guards are not a contract this +code may lean on, and the fix does not rely on them. Tests: 4 new `safeNextPath` cases (12 dot-segment spellings, external schemes and escapes, encoded slashes kept literal and legitimate paths unchanged, idempotence) and a `LoginRoute` case through the real router (`next=/..//evil.test/app/account` lands on the dashboard); on the old