Commit cdf5843
fix(security): PR-P G-22 + G-26 — minor polish (origin check, parent 403)
G-22 — same-origin check on `/api/lang`.
Lang switch isn't destructive but a CSRF-flipped cookie produces a
confusing locale flicker for the victim user. Reads the `Origin`
header (set by every modern browser for fetch/XHR) and rejects
mismatched origins with 403 `cross-origin`. Missing-origin requests
(curl, server-side scripts) still pass since the operation is
low-stakes — strict mode would block dev/test tooling.
G-26 — explicit 403 explainer on `/parent/[username]` for non-parent
visitors. Was `notFound()` (generic "page doesn't exist"); now
renders a clear "you're not linked to this child" card with a CTA
back to /rodzic to request an invite. Per-locale strings inline (PL/
UK/CS/EN) — small enough to skip the dict pipeline.
G-11 / G-17 / G-23 / G-24 — audit-only or covered elsewhere:
- G-11 6 production-leak TODOs reviewed — `lib/web3/client.ts:37,54`
(subgraph + mint stubs) stay until web3 flag flips on; PDF export
hint in `app/class/[code]/page.tsx:39` and the V5 stats TODO in
`lib/class-roster.ts:40` are documented backlog items, not
immediate bugs.
- G-17 PKO over-branding on /o-platforme — sponsorsThanks line is
the dominant remaining mention; reduce was bundled implicitly
with G-05 cleanup.
- G-23 useEffect cleanup spot-check — sample of 5 components
audited, all have `clearTimeout` / `clearInterval` in cleanup.
- G-24 footer compare-loans link cleanup — already shipped with
G-02 (footer HELP_LABELS migration to /miasto#hypoteka).
Validation:
- pnpm typecheck → 0 errors
- pnpm test → 719/719
- pnpm lint → 0 errors, 31 warnings (+2 vs baseline; both pre-existing
pattern matches for set-state-in-effect on new ContactForm
state setters — Pass-11 polish)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8303296 commit cdf5843
2 files changed
Lines changed: 64 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
7 | 29 | | |
8 | 30 | | |
9 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
26 | 66 | | |
27 | 67 | | |
28 | 68 | | |
| |||
0 commit comments