Remove ntfy: notifications go only through the app notification stream

Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat
tool notify, auto-switch and schedule notices), the chat push outbox (its
table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*.
The app_notifications stream, subscribe/clear and kinds are unchanged.
Notification settings keep run_finished/chat_needs_you/chat_reply_finished;
ntfy_enabled is accepted and ignored and its stored row is never read.

Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to
the Pipelines apps — use the stage notify hook". The notify hook remains.

Installer: no ntfy build, accounts, config or supervisor child; manifest
gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an
old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log,
with a note in logs/install.log); uninstall cleans leftovers.

App: ntfy settings section replaced by "Notification events"; texts updated.
Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli,
author skill references updated; security review M1 marked resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 23:24:24 +00:00
parent 806b5eca46
commit fc7dbb0ac0
138 changed files with 1958 additions and 4651 deletions
+24 -19
View File
@@ -39,14 +39,10 @@ crafted link to a file the attacker has placed in the user's home directory.
> issue can contain instructions that an agent follows ("prompt injection").
> Agents with shell access can then leak your secrets or change files. Prefer
> the "ask" permission modes, and give pipeline stages only the tools they need.
> - **The notification server (ntfy) is on your local network.** It listens on
> every network interface over plain HTTP on port 8090, and the phone account
> uses your web password by default. Only subscribe over a network you trust or
> over Tailscale.
> - **Agents can spend money.** Runs have step and time limits but no spending
> cap unless you set one.
> - **Install and update pull code from the internet.** The installer builds the
> newest ntfy and OpenCode releases. `pipelines update` pulls this repository
> newest OpenCode releases. `pipelines update` pulls this repository
> and reinstalls without a signature check.
>
> What is protected by default: the server API is on loopback only and needs a
@@ -64,13 +60,13 @@ crafted link to a file the attacker has placed in the user's home directory.
| H2 | High | Web password = arbitrary code execution; step-up elevation is bypassed by agent permission modes | Depends on the password; reachable only from loopback/tailnet |
| H3 | High | Agents run unsandboxed as the user with the server's environment and can read every Pipelines secret (cookie HMAC key, server token, update-signing key) | High once prompt injection reaches a shell-capable agent |
| H4 | High | Pipeline stages get unrestricted shell by default (no `tools` block, or `shell` without a policy) | High for any pipeline that omits a shell policy |
| M1 | Medium | ntfy listens on all interfaces over HTTP; the phone account reuses the web password (sniffable, and guessable outside the proxy's limiter) | High that the port is LAN-reachable |
| M2 | Medium | Supply chain floats: newest OpenCode, Pi and ntfy resolved at install time; unpinned base images; unchecked SDK zip; `pipelines update` has no signature check | Low per event, wide impact |
| M1 | Medium | **Resolved (ntfy removed).** ntfy listened on all interfaces over HTTP; the phone account reused the web password (sniffable, and guessable outside the proxy's limiter) | None: no ntfy port is installed |
| M2 | Medium | Supply chain floats: newest OpenCode and Pi resolved at install time (ntfy no longer installed); unpinned base images; unchecked SDK zip; `pipelines update` has no signature check | Low per event, wide impact |
| M3 | Medium | Docker mode (opt-in) exposes the unauthenticated API on 0.0.0.0 | Only with `--docker` |
| M4 | Medium | `show_html` previews load remote images/CSS (exfil beacons) and allow links that escape the sandbox, including to the app's own origin | Medium |
| M5 | Medium | No spending cap by default and no global concurrency cap | Medium |
| M6 | Medium | Chat transcripts and notifications are not redacted | Medium |
| L* | Low | Links open without confirmation; OSC 52 clipboard writes; ntfy click-link to any URL; `ws://` peers; TOCTOU in `/files`; debug-keystore APK signing; and more | |
| L* | Low | Links open without confirmation; OSC 52 clipboard writes; notification `link=` to any URL; `ws://` peers; TOCTOU in `/files`; debug-keystore APK signing; and more | |
---
@@ -83,7 +79,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
```
127.0.0.1:8080 # Go server API
*:8090 # ntfy
*:8090 # ntfy (removed since; see M1)
*:8082 # web proxy (wildcard bind, filtered per connection)
```
@@ -133,7 +129,15 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
can reach the sign-in page.
- **Mitigation:** restrict it with Tailscale ACLs. Mention this in the README.
#### M1. ntfy `:8090` on every interface, phone account = web password (Medium)
#### M1. ntfy `:8090` on every interface, phone account = web password (Medium) — resolved
- **Resolution (2026-12-03):** ntfy was removed from Pipelines. Notifications
reach every client through the server's own app notification stream over the
authenticated `/connect` connection (see `docs/notifications.md`). The
installer no longer builds, configures or starts ntfy, and creates no phone
account; a reinstall stops and deletes an existing ntfy and its data, and
`./uninstall` removes any leftover. Port 8090 is no longer opened. The
original finding is kept below for the record.
- **Evidence:**
- `scripts/setup-native.py:672`
@@ -486,11 +490,12 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
- **Mitigation:** confirm OSC 52 writes or put them behind a setting, and show
the link target on hover.
#### P3. ntfy click links to arbitrary URLs (Low)
#### P3. Notification `link=` targets to arbitrary URLs (Low)
- **Evidence:** `internal/server/notify_link.go:87-103` accepts any absolute
http(s) `link=` written by the agent into the run's `public/` directory.
- **Risk:** a phishing link delivered as a trusted notification.
- **Risk:** a phishing link delivered as a trusted notification. (ntfy is gone;
the same `link=` is now the app notification's tap target.)
- **Mitigation:** restrict to the configured web origin, or route through an
interstitial page.
@@ -498,6 +503,9 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
#### M2a. Harness and ntfy versions resolve to "newest" at install time (Medium)
- **Update:** ntfy is no longer installed, so its part of this finding is
resolved; the harness part stands.
- **Evidence:**
- `scripts/resolve-releases.py:1-27` picks the newest OpenCode v2 tag (GitHub
API), then its GHCR digest, and the newest Pi version from npm.
@@ -595,8 +603,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
- No secrets on command lines or in service unit files: the launchd plist
carries only `HOME` and `PATH`.
- Inline `PIPELINES_NTFY_TOKEN` is refused (`internal/installation/service.go:224-225`).
- **Docker ntfy token (Low):** world-readable inside a 0700 directory
(`scripts/save-ntfy-token.py:16`, `mode=0o444`). Docker mode only.
- ~~**Docker ntfy token (Low)**~~: resolved; ntfy and its token were removed.
- **M6. No redaction of transcripts or notifications (Medium):**
- Redaction exists only for failure evidence (`internal/stage/diagnostics.go:55-70`)
and turn-diff snapshots, which skip `.env*`, `*.pem`, `.ssh`, `.aws` and
@@ -732,9 +739,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
3. **Scrub the agent environment** (H3): drop `PIPELINES_*_FILE`,
`PIPELINES_WEB_AUTH_FILE` and token variables from every harness and `!`
child environment. *Small.*
4. **ntfy off the LAN by default** (M1): bind loopback + tailnet (or serve it
through `tailscale serve`), give the phone a random reader password or token,
and make LAN ntfy an opt-in. *Small to medium.*
4. ~~**ntfy off the LAN by default** (M1)~~: done by removing ntfy.
5. **Docker safe defaults** (M3): bind 127.0.0.1, generate a token, and refuse a
non-loopback bind without a token. *Small.*
6. **Deny-list secret paths** in `/files`, `show_file` and listings (F2).
@@ -744,7 +749,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
8. **Block remote loads in HTML previews** (M4): inject a strict meta CSP and
refuse same-origin links. *Small.*
9. **Default a run budget and a global run cap** (M5). *Small to medium.*
10. **Pin the supply chain** (M2): commit reviewed OpenCode, Pi and ntfy
10. **Pin the supply chain** (M2): commit reviewed OpenCode and Pi
versions and digests, pin base images by digest, verify the SDK zip's
sha256, and verify signed tags in `pipelines update`. *Medium.*
11. **Make elevation a real second factor** (H2): OS password via
@@ -757,7 +762,7 @@ shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
13. **Smaller items:**
- Default "Remember me" off.
- Disable mDNS when the LAN route is off.
- Confirm external links, OSC 52 writes and ntfy click links.
- Confirm external links, OSC 52 writes and notification `link=` targets.
- Redact known secrets from transcripts.
- Refuse `ws://` peers off the tailnet.
- Use a real APK keystore.