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