fix(domain): refuse three non-canonical v3 shapes, R5.5 LOW fixes, R5.6 plan

check_v3_shape at read_report_document v3 and parse_envelope (sheet, practitioner
as non-objects, severity as non-string); Protocol errors final; DEV address must be
an own unicast address. SQL confirm function and DEV keys characterised, no change.
This commit is contained in:
bchanot committed 2026-10-24 03:34:38 +02:00
1 parent 13db5539a3
commit d502dfa923
11 files changed
+369 -37

No files matched your search

+25
View File
@@ -149,6 +149,31 @@ service-worker features) and OAuth providers that refuse `http://` redirect
URIs. When one of those lands, the answer is a private HTTPS origin (local CA
or a private name with a certificate), never the production domain.
### 3.6 The API port 54321 and the stack's keys (checked 2026-10-24)
Measured on the host, no secret printed: `supabase/config.toml` sets no `jwt_secret` and no
signing keys, so the stack signs with the Supabase CLI's **public default** JWT secret and its
`service_role` key is the public demo key (`iss: supabase-demo`). Port 54321 is open to the LAN by
design (table above): any device of the private network that knows those public values can call
the API as `service_role`, past every RLS policy, on DEV data. Nothing of production is involved.
This is an owner decision (no automatic change): give the stack its own secret (a `jwt_secret` /
signing keys read with `env()` from a git-ignored file, then `pnpm db:reset` and new keys in
`.env.worker`), or narrow the 54321 allow rule to the test devices' addresses.
What the UFW listing alone does not prove for 54321, and how to check it (owner, by hand):
```bash
ss -ltnp 'sport = :54321' # who listens, on which address (0.0.0.0 / [::] expected)
sudo ufw status verbose # default incoming policy + any rule naming 54321
docker info -f '{{.SecurityOptions}}' # "rootless" expected: published ports are host sockets, UFW applies
sudo iptables -S DOCKER-USER 2>/dev/null # rootful Docker only: DNAT bypasses UFW, rules belong here
nc -zv -w 3 <DEV host> 54321 # from ANOTHER device: succeeds today (open by design)
nc -zv -w 3 <DEV host> 54322 # from another device: must fail (54323, 54324 too)
```
A DENY on 54322 to 54324 is effective only if the daemon is rootless (§3.1) and the probe from
another device fails; this machine cannot test its own LAN firewall (§3.3).
## 4. Procedure from another device (owner validation)
On the Ubuntu machine: `pnpm db:start`, `pnpm dev:gateway`, the worker