gunk-dev/the-valley

bd-d853d9c-bus-unauthenticated.md

source0d05e7f48050main's published tip history
1.5 KiB · Rendered
1---
2type: bug
3id: bd-d853d9c
4status: open
5title: The event bus is unauthenticated — a gate before consumers act or the listener widens
6created: 2026-07-17
7source: security review of phase1/event-log, 2026-07-17
8---
9
10# The event bus is unauthenticated
11
12Any local process can connect to the bus on localhost — publish forged events, subscribe, and reach
13the JetStream admin API (purge or delete the stream). The valley host is exactly the kind of machine
14where semi-trusted code runs routinely: dispatched agents work on it all day, and they are the
15processes a forged ref-updated event should be assumed to come from.
16
17Acceptable today by design: the bus is a rebuildable projection over events durable in git
18([architecture.md](../../design/architecture.md)), and the only consumer is a human watching valley
19tail. A forged event can mislead an observer, not corrupt state.
20
21The gate: before any automated consumer acts on an event, or before services.valley.bus.listen
22widens beyond localhost, the bus needs authorization — publisher credentials for the ref-updated
23hook, subscribe-only permissions for tails, JetStream administration restricted. Widening the
24listener and adding auth must land together: if the tailnet interface is trusted by the firewall,
25widening alone exposes the bus to every tailnet device.
26
27Related: consumers must trust the schema-validated repo payload field, never parse subject tokens —
28project names may contain dots, so tokenizing valley.git.<repo>.ref-updated is ambiguous.