security: the identity header header-trusting services sign in from can be forged on the private path and from mesh peers #1941

Closed
opened 2026-09-27 22:37:59 +00:00 by ben · 3 comments
Owner

Why human

These are sign-in trust changes: they decide who may present an identity to a service. By standing rule they go to Ben before landing.

What was found (2026-09-27, while building #1548)

The header-trusting services are Grist, LimeSurvey and now Omeka. They sign a person in from X-Idss-Identity and trust it outright. Two paths reach them without the front door vouching for that header:

  1. Private-path routes don't strip it. renderPrivateRoute proxies every service ungated (ADR 0150) and calls renderProxy(..., stripIdentity=false). So on a private-path community, a LAN neighbour can send X-Idss-Identity: operator to surveys.<apex> and land as LimeSurvey superadmin, or do the same to Grist. The Omeka module stays off on the private path for exactly this reason (ADR 0285 §4).
  2. Mesh peers can reach the serve ports directly. Each port opens its serve port on wt0 (for example 8086 Omeka, and LimeSurvey's and Grist's). Any community device on the mesh can hit it with a forged header, bypassing Caddy and the gate.

Proposed default

  1. Private path: strip X-Idss-Identity in renderPrivateRoute, like every exempt path on the public path. Header services then have no sign-in on the private path until it gains a gate, which is honest: today they have a forgeable one.
  2. Mesh: open each header-trusting service's serve port only to the front door's own address (the gateway's mesh IP), not the whole wt0 interface. Where the service shares the gateway host, loopback or the podman gateway is the only source.

Acceptance

  • A render test per header service: the private route strips the header; the serve port admits only the front door's source.
  • Live: a forged header from a mesh peer and from the private-path LAN gets no session.
## Why human These are sign-in trust changes: they decide who may present an identity to a service. By standing rule they go to Ben before landing. ## What was found (2026-09-27, while building #1548) The header-trusting services are Grist, LimeSurvey and now Omeka. They sign a person in from `X-Idss-Identity` and trust it outright. Two paths reach them without the front door vouching for that header: 1. **Private-path routes don't strip it.** `renderPrivateRoute` proxies every service ungated (ADR 0150) and calls `renderProxy(..., stripIdentity=false)`. So on a private-path community, a LAN neighbour can send `X-Idss-Identity: operator` to `surveys.<apex>` and land as LimeSurvey superadmin, or do the same to Grist. The Omeka module stays off on the private path for exactly this reason (ADR 0285 §4). 2. **Mesh peers can reach the serve ports directly.** Each port opens its serve port on `wt0` (for example 8086 Omeka, and LimeSurvey's and Grist's). Any community device on the mesh can hit it with a forged header, bypassing Caddy and the gate. ## Proposed default 1. Private path: strip `X-Idss-Identity` in `renderPrivateRoute`, like every exempt path on the public path. Header services then have no sign-in on the private path until it gains a gate, which is honest: today they have a forgeable one. 2. Mesh: open each header-trusting service's serve port only to the front door's own address (the gateway's mesh IP), not the whole `wt0` interface. Where the service shares the gateway host, loopback or the podman gateway is the only source. ## Acceptance - [ ] A render test per header service: the private route strips the header; the serve port admits only the front door's source. - [ ] Live: a forged header from a mesh peer and from the private-path LAN gets no session.
Author
Owner

A third path, and the worst: the container ports answer on the PUBLIC internet (found 2026-09-27)

Checked from a laptop on home wifi (not on the mesh) against whakatohea-demo's public IP:

Port Service Answer
8086 Omeka (podman) 200
8087 Grist (podman) 302
8083 LimeSurvey (native nginx) no answer

A request to :8086/admin with a made-up X-Idss-Identity was signed in and an account was created for it (probe account deleted afterwards).

Cause: the renders publish container ports as ports = [ "8086:8080" ], which podman binds on 0.0.0.0 and forwards with its own NAT rules. Those bypass the NixOS firewall, so networking.firewall.interfaces."wt0".allowedTCPPorts does not confine them. Native services (LimeSurvey) are confined as intended.

Reach: any gateway with a public IP that co-hosts a container port. Every podman-run catalogue service is reachable without the front door or the gate; for the header-trusting ones (Grist, Omeka) that means anyone can sign in as anyone, including a steward. It also exposes Omeka's site publicly, against the #1722 ruling.

Proposed fix, added to this ticket's scope: publish each container port on a named address only (127.0.0.1:<port> when the front door is on the same host, the node's mesh address otherwise), with a render test per container port that no publish is address-less.

## A third path, and the worst: the container ports answer on the PUBLIC internet (found 2026-09-27) Checked from a laptop on home wifi (not on the mesh) against whakatohea-demo's public IP: | Port | Service | Answer | |---|---|---| | 8086 | Omeka (podman) | 200 | | 8087 | Grist (podman) | 302 | | 8083 | LimeSurvey (native nginx) | no answer | A request to `:8086/admin` with a made-up `X-Idss-Identity` was signed in and an account was created for it (probe account deleted afterwards). **Cause:** the renders publish container ports as `ports = [ "8086:8080" ]`, which podman binds on `0.0.0.0` and forwards with its own NAT rules. Those bypass the NixOS firewall, so `networking.firewall.interfaces."wt0".allowedTCPPorts` does not confine them. Native services (LimeSurvey) are confined as intended. **Reach:** any gateway with a public IP that co-hosts a container port. Every podman-run catalogue service is reachable without the front door or the gate; for the header-trusting ones (Grist, Omeka) that means anyone can sign in as anyone, including a steward. It also exposes Omeka's site publicly, against the #1722 ruling. **Proposed fix, added to this ticket's scope:** publish each container port on a named address only (`127.0.0.1:<port>` when the front door is on the same host, the node's mesh address otherwise), with a render test per container port that no publish is address-less.
Author
Owner

Approved by Ben and landed (2026-09-27) — main 5e8141a2, GOTCHAS #355, live on whakatohea-demo

Closed:

  • Public internet and gateway mesh. A service on the gateway listens on loopback alone and opens no firewall port: the archive, data-collections and whakapapa containers, and the surveys web server. A container on a member device publishes on that device's mesh address, never address-less.
  • Private path. Every ungated route strips X-Idss-Identity.
  • Guard. TestNoContainerPortIsPublishedWithoutAnAddress renders every routable port and refuses an address-less publish. The any-sync yamux ports 3001/3003/3005 are allow-listed as public by design.

Proof on the demo, from a laptop off the mesh: :8083, :8086 and :8087 on the public IP no longer answer, the gateway's own mesh address doesn't either, and no firewall port is open for them. The front door still serves all four services, and a forged header sent to it is answered with the sign-in redirect. No unknown accounts in Omeka or Grist.

Still open — this ticket stays open for it: on a member device, another mesh peer can reach the serve port directly (container: published on the mesh address; native: open on wt0). Closing it needs a source rule ahead of podman's NAT that admits the gateway's mesh address only. No community runs a header-trusting service on a member device today; it needs a live member-device placement to prove.

Side effect to know: on the private path Grist now receives no identity (there is no gate to mint one), so it signs nobody in there. Before, it signed in whoever the caller claimed to be.

## Approved by Ben and landed (2026-09-27) — main 5e8141a2, GOTCHAS #355, live on whakatohea-demo **Closed:** - **Public internet and gateway mesh.** A service on the gateway listens on loopback alone and opens no firewall port: the archive, data-collections and whakapapa containers, and the surveys web server. A container on a member device publishes on that device's mesh address, never address-less. - **Private path.** Every ungated route strips `X-Idss-Identity`. - **Guard.** `TestNoContainerPortIsPublishedWithoutAnAddress` renders every routable port and refuses an address-less publish. The any-sync yamux ports 3001/3003/3005 are allow-listed as public by design. **Proof on the demo**, from a laptop off the mesh: `:8083`, `:8086` and `:8087` on the public IP no longer answer, the gateway's own mesh address doesn't either, and no firewall port is open for them. The front door still serves all four services, and a forged header sent to it is answered with the sign-in redirect. No unknown accounts in Omeka or Grist. **Still open — this ticket stays open for it:** on a **member device**, another mesh peer can reach the serve port directly (container: published on the mesh address; native: open on `wt0`). Closing it needs a source rule ahead of podman's NAT that admits the gateway's mesh address only. No community runs a header-trusting service on a member device today; it needs a live member-device placement to prove. **Side effect to know:** on the private path Grist now receives no identity (there is no gate to mint one), so it signs nobody in there. Before, it signed in whoever the caller claimed to be.
Author
Owner

Closed 2026-10-21 (Ben's stale sweep): approved by Ben and landed 2026-09-27 (main 5e8141a2, GOTCHAS #355), proven live on whakatohea-demo per the last comment.

Closed 2026-10-21 (Ben's stale sweep): approved by Ben and landed 2026-09-27 (main `5e8141a2`, GOTCHAS #355), proven live on whakatohea-demo per the last comment.
ben 2026-10-21 14:17:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1941
No description provided.