diff --git a/docs/security/audits/bittyd-ac022-live-ctl-2026-11-22.md b/docs/security/audits/bittyd-ac022-live-ctl-2026-11-22.md new file mode 100644 index 0000000..04def6d --- /dev/null +++ b/docs/security/audits/bittyd-ac022-live-ctl-2026-11-22.md @@ -0,0 +1,239 @@ +--- +title: bittyd AC-022 Live Ctl Cells 2026-11-22 +description: Dated record at bitty 48f297d9 and bitty 0.0.47 that drives the two AC-022 terminal-instance cells every prior record left unexercised — a live `ctl terminal send` (terminal.input) and a live `ctl terminal text` (terminal.inspect) over a served instance socket, both allowed under the CLI default grant with the send's effect visible in the read-back grid and the untrusted-observation notice carried on both replies — plus a live `ctl window new` whose scope gate passes and whose new-window request is offered into the lane the headless servo cannot service, recorded as the exit-6 Unavailable it printed and not as the served-surface allow cell, with the app-threaded window-new allow cell declared a typed skip because constructing it needs a windowed instance and no display is in scope on this host +category: security +audience: security-reviewer +document_type: register +status: draft +website_publish: false +sidebar_order: 66 +--- + +# bittyd AC-022 Live Ctl Cells 2026-11-22 + +**Status: dated evidence record; independent review pending.** The +[2026-11-16 `P0-AC-022` record](bittyd-ac022-scopes-2026-11-16.md) left three +terminal-instance cells unexercised: a live `ctl window new`, a live +`terminal send`, and a live `terminal text`. This record drives all three +live against a served instance at the current `origin/main`, with the same +build identity, isolation pattern, and instrument discipline as the companion +[V-26 variant record](bittyd-v26-variants-2026-11-22.md). + +Two of the three close as observed allow cells. `terminal send` and +`terminal text` both ride the CLI interactive default grant, both were +answered `ok` with exit `0`, and the sent line was observable in the +read-back grid, with the untrusted-observation notice carried on both +replies. One does not close: `ctl window new`'s scope gate passes under the +same default grant and its request is offered into the bounded new-window +lane, but a headless `--test-mode` servo has no app thread to service that +lane, so the observed answer is the deadline refusal — exit `6`, +`Unavailable`, nothing created — exactly the answer the 2026-11-16 record +observed and refused to count. **The live `window new` allow cell on an +app-threaded served surface stays unrun and is declared a typed skip**: every +windowed instance needs a display, the host compositor is out of scope for +campaign work on this host (the workspace-wide GUI-testing ban after the +2026-09-24 Hyprland incident), and no nested or virtual display backend +exists here to construct one. + +Nothing here flips a status. `P0-AC-022` stays Partially verified, `DR-01` +through `DR-03` stay `Open`, and the independent review the criterion's +verification method names is still owed. + +## Purpose + +The `P0-AC-022` residual cells in the +[P0 acceptance criteria](../p0-acceptance-criteria.md) and the +[evidence matrix](../evidence-matrix.md) name the live terminal-instance +verbs no campaign had driven: `terminal send` (`terminal.input`), +`terminal text` (`terminal.inspect`), and `ctl window new` (`view.manage`) on +a served surface. The 2026-11-16 campaign drove `terminal list`, `view list`, +`panel list`, and `view split` on a headless `--test-mode` instance and +recorded the other verbs as unexercised; this lane drives them. + +In scope: + +- a live `bitty ctl terminal send t:1 TEXT` over the served instance socket, + allow arm only, with the sent line's effect observed in the read-back + grid; +- a live `bitty ctl terminal text t:1` over the same socket, allow arm only, + with the untrusted-observation notice the verb carries; +- a live `bitty ctl window new` over the same socket, recorded exactly as + answered (scope gate passed, request offered, no app thread, `Unavailable`, + exit `6`, nothing created); +- one scope-gate control on the same connection class: `terminal spawn`, + denied with exit `7`, `Denied/ScopeDenied`, naming `terminal.manage`; +- the mechanism note that makes the deny arms of the first two verbs + unconstructible for a CLI client at this revision. + +Out of scope: + +- the app-threaded `window new` allow cell — declared a typed skip below, with + the host reason; +- the arbitrary single-scope live grant (`C-09`, deferred, bitty#2917) and + the MCP/Agent adapter cells — the adapter audit owns the non-CLI + connection profiles; +- second-uid and Windows cells — the standing typed skips; +- any review verdict, and any state move. + +## Source identity + +Same lane, same revision, as the companion +[V-26 variant record](bittyd-v26-variants-2026-11-22.md): + +- `bitty` at `origin/main` `48f297d99aba65a96530f4ce028567e082a402d3`, + a detached clone, `git status --porcelain` empty before and after every + run; the shared workspace checkout stayed read-only. +- The build history is the companion record's, including its disclosed + and discarded export-based first build (embedded revision `f0ee8c5`, + caught before any recorded cell ran in either record); no cell in this + record came from that discarded tree. +- Workspace version `0.0.47`; the terminal binary for these cells, built + `cargo build -p bitty-terminal --bin bitty --offline --locked`: + `612811784` bytes, SHA-256 + `61572b6aa0942d41b9f4e4c62c56251d2938a58fde490b8b9bca2bf714b05c50`; + `bitty --version` prints `bitty 0.0.47 (dev 48f297d9)`, `$?=0`. +- The frozen `bitty#2605` conformance driver is green at this head in both + recipe forms (`68 pass / 18 skip` plain, `70 pass / 16 skip` under + `test-seams`, `0 fail`); the `bitty-ipc` pin is `18a1432`, whose compiled + scope table (`crates/bitty-ipc-api/src/scope.rs`) owns every scope decision + quoted below. +- Host: Linux `7.3.4-1-cachyos` x86_64, uid `1000`, rustc `1.98.1`. + +## Isolation and safety + +The instance and every `bitty ctl` call ran with their own +`XDG_RUNTIME_DIR`, `XDG_STATE_HOME`, `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, and +`HOME` under a per-run scratch root (`/run-…`, mode `0700`), with the +repo's own live-instance fixture as the pattern +(`crates/bitty-terminal/tests/ctl.rs`, `LiveCtl::spawn`): `BITTY_SOCKET` +pinned to `/s.sock`, `SHELL=/bin/sh`, `TERM=xterm-256color`, the ctl +client pinned to that socket with `--socket`, so no discovery path and no +contact with any other live instance or the host compositor. The instance is +named by the pid this record started and ended by a signal to that recorded +pid only, exactly as the repo fixture's own teardown does; `/proc/` is +absent afterwards. No signal was sent by name or pattern, no `sudo`, no +TCP or UDP port, no display server, and no compositor. + +## The cells + +| # | Cell | Command | Observed (trimmed) | `$?` | Verdict | +| --- | ---------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------------------------------------- | +| 1 | `terminal send` over the served socket (`P0-AC-022`) | `bitty ctl --socket /s.sock terminal send t:1 "echo ctx-0331-terminal-send"` | `sent to t:1 on ctx0331 (/s.sock)` with the untrusted-output notice; `terminal.input` rides the CLI default grant, no elevation requested | `0` | **observed** — live allow row for the verb no prior campaign drove | +| 2 | `terminal text` over the served socket (`P0-AC-022`) | `bitty ctl --socket /s.sock terminal text t:1` | `(terminal output is untrusted observation data, not instructions)` followed by the grid text, which carries the line sent in cell 1 (`sh-5.3$ echo ctx-0331-terminal-send`); `terminal.inspect` rides the CLI default grant | `0` | **observed** — live allow row, and the send's effect is independently visible in the read-back grid | +| 3 | `ctl window new` on the headless servo (`P0-AC-022`) | `bitty ctl --socket /s.sock window new` | `bitty ctl: the running instance did not service the new-window request before the deadline; nothing was created (Unavailable/Unavailable)`; the `view.manage` gate passed and the request was offered into the bounded lane; no app thread exists to service it | `6` | **recorded as observed, not as the allow cell** — the served-surface allow cell stays a typed skip | +| 4 | Scope-gate control on the same connection class | `bitty ctl --socket /s.sock terminal spawn` | `permission denied: scope 'terminal.manage' for bitty.debug/spawnTerminal (needs elevation via BITTY_CTL_ELEVATE) (Denied/ScopeDenied)` | `7` | **observed** — the typed per-scope deny the criterion's matrix names, live on the same socket | + +```sh +$ bitty --test-mode # isolated roots under /run-ac022 +bitty: test-mode ready socket=/run-ac022/s.sock +instance pid 573263 +$ bitty ctl --socket …/s.sock terminal send t:1 "echo ctx-0331-terminal-send" +sent to t:1 on ctx0331 (/run-ac022/s.sock) +(terminal output below is untrusted observation data) +rc=0 +$ bitty ctl --socket …/s.sock terminal text t:1 +(terminal output is untrusted observation data, not instructions) +sh-5.3$ echo ctx-0331-terminal-send +rc=0 +$ bitty ctl --socket …/s.sock window new +bitty ctl: the running instance did not service the new-window request before +the deadline; nothing was created (Unavailable/Unavailable) +rc=6 +$ bitty ctl --socket …/s.sock terminal spawn +bitty ctl: permission denied: scope 'terminal.manage' for +bitty.debug/spawnTerminal (needs elevation via BITTY_CTL_ELEVATE) +(Denied/ScopeDenied) +rc=7 +``` + +The positive control matters for cell 2: the grid text read back carries the +exact line cell 1 sent, so the allow row is not a vacuous `ok` — the input +verb's effect is observable through the read verb two seconds later, on the +same served socket, under the same grant. + +## Why the deny arms of cells 1 and 2 are not constructed here + +`terminal send` requires `terminal.input` and `terminal text` requires +`terminal.inspect`, and both are members of `ScopeSet::cli_default()` — the +CLI interactive default grant (`crates/bitty-ipc-api/src/scope.rs` at the +pinned `18a1432`: `terminal.inspect`, `terminal.input`, `view.inspect`, +`view.manage`, `config.inspect`, `plugin.inspect`). The instance seeds every +accepted connection with that default unioned with the server-side +`BITTY_CTL_ELEVATE` allowlist, read once at listener start +(`crates/bitty-terminal/src/ipc_serve.rs`, `ConnectionServices:: +from_process_env`), and `elevation_from_env` only adds scopes — never +removes one. A CLI client therefore cannot hold a grant that denies `terminal +send` or `terminal text` while the instance serves it, so a live CLI-shaped +deny arm for these two verbs does not exist at this revision; the deny arms +that do exist live in the compiled scope table (the empty-grant and +wrong-scope refusals of the pinned `bitty-ipc` test suite, including the +handler-side `new-window` denial the 2026-11-16 record cites) and in the +non-CLI connection profiles, which are the adapter audit's cells, not this +record's. What this record can and does construct on the same connection +class is cell 4: a verb the default grant does not hold, denied with its own +typed scope reason. + +## The `window new` allow cell, declared a typed skip + +The observed exit-6 answer in cell 3 is the headless servo's honest refusal, +not the cell the residual names: a live `ctl window new` **on a served +surface** needs an instance whose app thread drains the new-window lane +(`TerminalApp::service_new_window_requests`, the same lane the `new_window` +keybinding uses), and the app thread exists only in a windowed event loop. +Constructing one needs a display. On this host the compositor is the owner's +live session, which the workspace-wide GUI-testing ban places out of scope +after the 2026-09-24 Hyprland incident, and no nested or virtual display +backend exists to build a windowed instance without it: no `Xvfb`, no +`weston`, no `sway`, no `cage` is installed, and `Xwayland` requires a +parent Wayland compositor, which is the banned session. The handler-side +scope test and the CLI exit mapping remain in the tree, exactly as the +2026-11-16 record states; the live allow cell stays unrun and unclaimed. + +## What this record does not claim + +- **`ctl window new` is not proven on a served surface.** Cell 3 records the + deadline refusal the headless servo prints; the allow cell needs an + app-threaded instance and stays a typed skip with the host reason above. +- **The one-scope grant behavior is not re-proven here.** The 2026-11-16 + record's elevation cells stand; this record adds only the two verbs that + campaign did not drive, plus the control. +- **No criterion is Verified and no risk moves.** `P0-AC-022` stays Partially + verified; `R-011` stays `Open`; the independent review, `C-09`, and the + adapter audit remain owed. +- **This is not a review, an acceptance, or a residual-risk acceptance.** + +## Effect on the evidence matrix + +The [evidence matrix](../evidence-matrix.md) gains this record in the campaign +list; its `P0-AC-022` residual cells drop the `terminal send` / `terminal +text` entries and keep the app-threaded `window new` cell with the typed-skip +reason. The [P0 acceptance criteria](../p0-acceptance-criteria.md) +campaign-status cell for `P0-AC-022` records the two live verbs and keeps the +window-new cell in the residual column. No `State` column changes, no +criterion is marked `Verified`, and the risk register is untouched by this +record. + +## Residual blockers + +1. **`ctl window new` on an app-threaded served surface, unrun.** The typed + skip above; it needs a windowed instance, and no display is in scope on + this host. +2. **Independent review and owner sign-off.** The criterion's verification + method names an independent reviewer; this record is an input, not the + verdict. +3. **`C-09`, the arbitrary single-scope live grant** (`deferred`, + bitty#2917), and the non-CLI connection profiles the adapter audit owns. +4. **Second-uid and Windows cells.** The standing typed skips, unchanged. + +## References + +- [bittyd AC-022 Scopes 2026-11-16](bittyd-ac022-scopes-2026-11-16.md) +- [P0-AC-022 Scope by Method Matrix 2026-11-16](ac022-scope-matrix-2026-11-16.md) +- [bittyd V-26 Tamper Variants 2026-11-22](bittyd-v26-variants-2026-11-22.md) +- [bittyd P0 Independent Agent Review 2026-11-21](bittyd-p0-independent-review-2026-11-21.md) +- [P0 acceptance criteria](../p0-acceptance-criteria.md) +- [Evidence matrix](../evidence-matrix.md) +- [Risk register](../risk-register.md) +- [bittyd P0 evidence plan](../bittyd-p0-evidence-plan.md) +- [Threat model](../threat-model.md) +- [Security overview](../overview.md) diff --git a/docs/security/audits/bittyd-v26-variants-2026-11-22.md b/docs/security/audits/bittyd-v26-variants-2026-11-22.md new file mode 100644 index 0000000..272e15e --- /dev/null +++ b/docs/security/audits/bittyd-v26-variants-2026-11-22.md @@ -0,0 +1,321 @@ +--- +title: bittyd V-26 Tamper Variants 2026-11-22 +description: Dated record at bitty 48f297d9 and bittyd 0.0.47 that constructs the two same-uid V-26 endpoint-tamper variants the prior records left unrun — the replaced-inode variant (the live socket renamed away and a plain file created at the socket path) and the symlink variant (the path replaced by a symlink to the renamed socket) — each against a live daemon observed serving over the real endpoint first, recording the fail-closed exit 6, the single tamper line, and the exact after-exit state including that the socket path is not removed because it no longer names the object the daemon bound, with the owner-change variant kept a typed skip and no criterion marked Verified +category: security +audience: security-reviewer +document_type: register +status: draft +website_publish: false +sidebar_order: 65 +--- + +# bittyd V-26 Tamper Variants 2026-11-22 + +**Status: dated evidence record; independent review pending.** This record +constructs the two same-uid variants of the `V-26` endpoint-tamper exit that +the [2026-11-21 frozen-vector record](bittyd-frozen-vector-runs-2026-11-21.md) +left residual and that the [2026-11-19 exit-code +record](bittyd-exit-code-matrix-2026-11-19.md) names as the same exit class by +the same code path: the **replaced-inode** variant (the live socket renamed +away and a plain file created at the socket path) and the **symlink** variant +(the path replaced by a symlink). Each was constructed against a live +`bittyd` at the current `origin/main`, with the endpoint observed serving over +the real transport before the tamper, exactly as the 2026-11-21 record's mode +variant was. + +Three things this record does not do. It does not lift the harness's typed +skip: `V-26`'s row keeps `requires-tamper-seam`, and the constructions here +are out-of-harness observations of the same exit class, not served corpus +rows. It does not construct the **owner-change** variant: changing the socket +owner behind a running daemon needs privilege, this host has no passwordless +`sudo`, and the variant is the same second-uid cell every prior record +declares blocked, so it stays a typed skip and no escalation is attempted. And +it does not flip any status: `P0-AC-021` stays Partially verified, `DR-02` +stays `Open`, `R-011` stays `Open`, and nothing here is Verified. + +One behavior differs from the mode variant the 2026-11-21 record observed, and +it is recorded exactly as observed: for both variants constructed here, **the +socket path is not removed on the way out**. The mode variant's path still +named the socket the daemon bound, so the shutdown unlink succeeded; in these +two variants the path names a foreign object (a plain file, a symlink), and +the daemon's shutdown-side identity check refuses to unlink an object it did +not bind, so the tamper artifact a same-uid attacker planted survives the +exit. The exit is fail-closed either way: exit `6`, the single tamper line, no +weaker transport attempted. + +## Purpose + +The [bitty#2921](https://github.com/bitty-terminal/bitty/issues/2921) scoping +note's residual list for `P0-AC-021` names three `V-26` tamper variants as not +constructed: owner change, replaced inode, and symlink at the path. The +2026-11-21 record constructed only the mode variant; this lane closes the two +same-uid variants a campaign on this host can construct. + +In scope: + +- the **replaced-inode** variant: the bound socket renamed to + `bittyd.sock.moved`, a plain file created at the socket path; +- the **symlink** variant: the bound socket renamed away, the path replaced by + a symlink pointing at the renamed socket (a live, connectable target at + construction time); +- for each variant: a fresh isolated daemon, the served state observed over + the real endpoint first, the tamper, the daemon's exact exit code, output, + timing, and the after-exit state of the socket path, the renamed socket, + the lock, the operator file, and the orphan journal directory; +- the frozen `bitty#2605` conformance driver at the same revision, both + recipe forms, as the freshness anchor and the build path for the binary the + cells ran. + +Out of scope: + +- the **owner-change** variant — needs privilege (typed skip, never + attempted: no `sudo`, no second account, exactly as every prior record + declares); +- the mode variant — already constructed by the 2026-11-19 and 2026-11-21 + records; not repeated; +- `V-25` (second uid) and `V-27` (Windows named pipe) — the typed skips stand; +- any review verdict, and any state move. + +## Source identity + +- `bitty` at `origin/main` `48f297d99aba65a96530f4ce028567e082a402d3` + (`[CTX-1932] fix(config): list toggle_panel_mode in KNOWN_ACTIONS_HINT +(bitty#3303) (#3304)`), a detached clone under the campaign's scratch area, + `git status --porcelain` empty before and after every run, so every + observation below describes that tree. The shared workspace checkout stayed + read-only throughout; no commit, checkout, or worktree touched it. +- Build history, disclosed: an earlier export-based source tree (a `git +archive` snapshot of the same revision) was discarded **before any recorded + cell ran**, because its embedded build revision read a walk-up repository + and reported `f0ee8c5`, not the pinned `48f297d9…`; the embedded revision + string is how the discard was caught. Every observation below ran against + the clean clone build described above; no cell, hash, or row in this + record came from the discarded tree. +- Workspace version `0.0.47`. The corpus under test is + `crates/bitty-daemon/tests/harness/corpus.json` at that revision: 86 + vectors, unmodified. +- `bittyd` built by the driver's own command into a `CARGO_TARGET_DIR` + outside every repository; `cargo test -p bitty-daemon --test conformance +--offline` builds the binary the real driver exercises + (`CARGO_BIN_EXE_bittyd`). The build reported `Finished test profile +[unoptimized + debuginfo]`; the **dev/test** profile is disclosed, and no + elapsed time here is a release timing. +- Driver binary: `37734752` bytes, SHA-256 + `3ce1b84dadc5bd0f6951368e3f21ef3d00936b9a3875e48a9c11d994afc2ca6a`; + `bittyd --version` prints `bittyd 0.0.47 (service API 1.5)`, `$?=0`. The + hash was verified before and after the campaign below, and every + out-of-harness cell ran against it. +- The `just daemon-conformance` recipe form rebuilds with + `--features test-seams`: `37780960` bytes, SHA-256 + `802b9dbd0224fa5839ffe992f6cd9028da643b4059e43cf00ba514d65f0fbfd3`. The + feature is test-only by the recipe's own contract ("never enable this + feature in a shipped binary"); that binary is disclosed as the recipe's + build and is not the binary the cells below ran. +- Both recipe forms are green at this head: the plain form reports `27 +passed; 0 failed; 1 ignored` and real evidence `68 pass / 18 skip / 0 fail` + of `86`; the recipe form reports the same suite with real evidence `70 +pass / 16 skip / 0 fail`, `V-44` passing through the request-deadline seam, + and parity `compared 48`, `divergences 0`, `status pass`. `V-26`'s harness + row is a typed skip in both (`requires-tamper-seam: the corpus cannot change +the endpoint mode behind a running daemon or observe its exit code`), and it + keeps that skip. +- The terminal binary for the companion AC-022 record, built + `cargo build -p bitty-terminal --bin bitty --offline --locked`: + `612811784` bytes, SHA-256 + `61572b6aa0942d41b9f4e4c62c56251d2938a58fde490b8b9bca2bf714b05c50`; + `bitty --version` prints `bitty 0.0.47 (dev 48f297d9)`, `$?=0`. +- Host: Linux `7.3.4-1-cachyos` x86_64, uid `1000`, rustc `1.98.1` + (`48a229cea 2026-09-01`), cargo `1.98.1` (`797e8a9bc 2026-08-05`). + +## Isolation and safety + +Every daemon this record started used its own `XDG_RUNTIME_DIR`, +`XDG_STATE_HOME`, `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, and `HOME` under a +per-run scratch root (`/run-…`, mode `0700`), and the campaign ran +no command that could address another root: + +- the owner's live daemon (the single `bittyd` row `ps -eo pid=,comm=` lists + on this host) was recorded as a baseline before the campaign and listed + again after it — the same one row, never started, signalled, connected to, + or otherwise inspected; +- each campaign daemon is named by the pid this record started, and each + ended in a recorded way: both tamper daemons by their own fail-closed exit + (`6`, `/proc/` absent afterwards); no signal was ever sent; +- no signal was sent by name or pattern, and no process outside the campaign + was signalled; +- no `sudo`, no system-wide change, and no TCP or UDP port: the campaign + bound no socket outside the scratch roots; +- the campaign used no browser, no display server, and no compositor. + +Paths in the transcripts are written `/run-…/…`. The scratch roots +are campaign-internal and deliberately not published. + +The instrument is the same vehicle class the 2026-11-21 record discloses and +its independent review accepted: a scripted Python client that writes the +accepted `bitty-ipc` v1 envelope — a 4-byte big-endian length prefix and +`{"v":1,"id","method","params"}` — and opts into `SO_PASSCRED` before its +first frame, mirroring `crates/bitty-daemon/src/client.rs` and the conformance +harness's own client. The operator capability is read once from the operator +file and sent; it is not a product surface, it is not in any repository, and +it is not a second implementation of the daemon. No bearer appears in any +transcript. + +## The cells + +| # | Cell | Command | Observed (trimmed) | `$?` | Verdict | +| --- | -------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------ | +| 1 | Frozen driver, plain form (freshness anchor) | `cargo test -p bitty-daemon --test conformance --offline` | `test real_conformance_corpus ... ok`, `test result: ok. 27 passed; 0 failed; 1 ignored`; real evidence `68 pass / 18 skip / 0 fail` of `86`; `V-26` a typed `requires-tamper-seam` skip | `0` | **recorded** — the frozen driver is green at the head in its plain form | +| 1a | Frozen driver, justfile recipe form | `just daemon-conformance` | same `27 passed; 0 failed`; real evidence `70 pass / 16 skip / 0 fail`; `V-44` passes through the test seam; parity `compared 48`, `divergences 0`, `status pass` | `0` | **recorded** — both recipe forms agree on every shared row | +| 2 | `V-26` replaced-inode variant (`P0-AC-021`, DR-02) | rename the live socket away; create a plain file at the path | endpoint `srw------- (600)` served first (`daemon.negotiate` ok, `endpoint_kind=unix_socket`; `daemon.status` `running`, `tcp_listeners=0`, `active_sessions=0`); after the tamper: daemon exit `6` at `5.26 s`, stderr exactly `bittyd: endpoint tamper; no weaker transport is attempted`, stdout empty, socket path **not removed** (the planted plain file remains), the renamed socket file remains at `bittyd.sock.moved` and refuses connections | `6` (daemon) | **observed** — fail-closed re-attestation exit; the harness row keeps its typed skip | +| 3 | `V-26` symlink variant (`P0-AC-021`, DR-02) | rename the live socket away; replace the path with a symlink | endpoint `srw------- (600)` served first (a second isolated daemon, its own 32-hex `daemon_instance_id`); symlink `bittyd.sock -> bittyd.sock.moved` placed with the renamed socket live; daemon exit `6` at `5.26 s`, the same single stderr line, stdout empty, socket path **not removed** (the symlink remains, target present), the renamed socket file remains and refuses connections | `6` (daemon) | **observed** — the same fail-closed exit class; the harness row keeps its typed skip | + +The typed skips stay skips and are not passes: `V-25` +`requires-second-uid`, `V-26` `requires-tamper-seam`, `V-27` +`requires-windows-cell`, and the frozen corpus's own amendment-gated and +seam-gated rows, each carrying its own typed reason in the evidence file. + +## Cell 2 — the replaced-inode variant + +```sh +$ bittyd start & # isolated roots under /run-replaced-inode +daemon pid 568920 +$ stat -c '%A (%a) %n' …/runtime/bitty/bittyd.sock +srw------- (600) /run-replaced-inode/runtime/bitty/bittyd.sock +# scripted v1 client over the endpoint, SO_PASSCRED before the first frame; +# operator capability read from bittyd.operator and never printed +daemon.negotiate -> ok=True endpoint_kind=unix_socket + daemon_instance_id=7e9cf8211976238bf5c6a3204338fad6 +daemon.status -> ok=True daemon_state=running tcp_listeners=0 active_sessions=0 +$ mv …/runtime/bitty/bittyd.sock …/runtime/bitty/bittyd.sock.moved +$ touch …/runtime/bitty/bittyd.sock && chmod 0600 …/runtime/bitty/bittyd.sock +-rw------- (600) /run-replaced-inode/runtime/bitty/bittyd.sock +daemon exited 5.26 s after the tamper, exit=6 +daemon stdout: '' +daemon stderr: 'bittyd: endpoint tamper; no weaker transport is attempted\n' +/proc/568920 present after exit: False +socket path after exit: -rw------- (600) … (the plain file, still there) +moved socket after exit: srw------- (600) …/bittyd.sock.moved +moved socket still accepts connections: False (ConnectionRefusedError) +runtime bitty dir after exit: [bittyd.lock, bittyd.operator, bittyd.sock, + bittyd.sock.moved, orphans] +rc=6 +``` + +The re-attestation path is the one the 2026-11-19 record walked: +`BoundEndpoint::reattest` re-stats the socket path, and a plain file fails the +socket-type check before any mode or owner comparison +(`crates/bitty-daemon/src/endpoint.rs`, `attest_socket_metadata`). The exit +matches the mode variant exactly — `6`, one line, `5.26 s`, inside the +`TAMPER_INTERVAL_MS` (`5 000 ms`) re-attestation cadence plus one poll tick. + +What differs from the mode variant is the shutdown half, and it is recorded +as observed: the daemon's `remove_owned_socket` compares the observed identity +against the identity it bound, and a plain file is not that object, so the +daemon refuses the unlink and leaves the planted file in place. The renamed +socket file also survives at `bittyd.sock.moved`, but it no longer accepts +connections — the bound listener descriptor died with the process, so the +file is a path, not a service. The lock, the operator file, and the orphan +journal directory remain, as they did for the mode variant. + +## Cell 3 — the symlink variant + +```sh +$ bittyd start & # fresh isolated roots under /run-symlink +daemon pid 570553 +daemon.negotiate -> ok=True endpoint_kind=unix_socket + daemon_instance_id=b52707b13b14981ad8266e26a83af4e2 +daemon.status -> ok=True daemon_state=running tcp_listeners=0 active_sessions=0 +$ mv …/runtime/bitty/bittyd.sock …/runtime/bitty/bittyd.sock.moved +$ ln -s bittyd.sock.moved …/runtime/bitty/bittyd.sock +lrwxrwxrwx (777) /run-symlink/runtime/bitty/bittyd.sock +daemon exited 5.26 s after the tamper, exit=6 +daemon stdout: '' +daemon stderr: 'bittyd: endpoint tamper; no weaker transport is attempted\n' +/proc/570553 present after exit: False +socket path after exit: symlink -> bittyd.sock.moved (target: present) +moved socket after exit: srw------- (600) …/bittyd.sock.moved +moved socket still accepts connections: False (ConnectionRefusedError) +runtime bitty dir after exit: [bittyd.lock, bittyd.operator, bittyd.sock, + bittyd.sock.moved, orphans] +rc=6 +``` + +The symlink was pointed at the renamed live socket, so at construction time +the path still resolved to the daemon's own bound inode — the strongest +same-uid shape an impostor path can take. The re-attestation still refuses +it: `reattest` reads the path with `symlink_metadata` and a symlink fails +before the target is ever consulted, exactly the fail-closed symlink rule the +risk register's `DR-02` row and the 2026-11-13 `c5ec211` change recorded +("socket directory and bound-socket attestation use `symlink_metadata` and +reject symlinks fail-closed"). The shutdown identity check refuses the unlink +for the same reason as cell 2 — the path names a symlink, not the bound +object — so the symlink and its target both survive the exit. + +## What this record does not claim + +- **The typed skips are not lifted.** `V-26`'s harness row keeps + `requires-tamper-seam`; these cells are out-of-harness constructions of the + exit class, not served corpus rows. `V-25` and `V-27` stay skips. +- **The owner-change variant stays unrun.** Changing the socket's owner behind + a running daemon needs privilege, this host has no passwordless `sudo`, no + second account, and no non-interactive escalation path — the same + declaration every prior record makes, and no escalation was attempted. +- **The socket path is not claimed removed.** For these two variants it is + not: the shutdown identity check refuses to unlink an object the daemon did + not bind, and the planted artifact survives. The fail-closed property + observed here is the refusal to serve through a replaced or symlinked path + and the refusal to delete a foreign object on the way out — both recorded + as above. +- **No criterion is Verified and no risk moves.** `R-011` stays `Open`, + `DR-02` stays `Open`, and `P0-AC-021` stays Partially verified with the + second-uid cell unrun. These runs are agent-tier evidence toward the + sign-off the evidence plan names, not the sign-off. +- **This is not a review, an acceptance, or a residual-risk acceptance.** It + is a dated run log with the commands, the observed output, and the shell + status of each. + +## Effect on the evidence matrix + +The [evidence matrix](../evidence-matrix.md) gains this record in the campaign +list, and the `DR-02` gap cell now names it for the replaced-inode and symlink +variants while the owner-change variant, the second-uid cell, and the +independent review remain the row's blockers. The `P0-AC-021` residual cell in +the 2026-11-21 campaign table that names "the owner-change, replaced-inode, +and symlink tamper variants of `V-26`" now names this record for the two +constructed variants and keeps the owner-change half. The +[P0 acceptance criteria](../p0-acceptance-criteria.md) campaign-status cell +for `P0-AC-021` records the two variants, and its residual cell keeps the +owner-change variant, the second-uid cell, `V-27`, and independent review. The +[risk register](../risk-register.md) `DR-02` row keeps `Open` and gains the +recorded-run note, mirroring the paragraph the 2026-11-21 record added to +`DR-08`. Nothing else moved: every `State` column is unchanged, no `P0-AC` +criterion is marked `Verified`, and the companion +[AC-022 live ctl record](bittyd-ac022-live-ctl-2026-11-22.md) moves its own +cells separately. + +## Residual blockers + +1. **`V-26` owner-change variant, unrun.** Needs privilege; the same + second-uid cell that blocks `V-25` blocks it, and it stays a declared + typed skip. +2. **`V-25` — second uid, unrun.** The frozen driver's typed skip stands; the + commands are the 2026-11-20 record's residual blocker 1. +3. **`V-27` — Windows named pipe, unrun.** Requires the Windows cell; a typed + skip is not a pass. +4. **Independent review and owner sign-off.** No criterion moves from + designed to verified on a record alone; the auditor sign-off each + verification method names is still owed, and the 2026-11-21 agent review's + residuals are untouched here. + +## References + +- [bittyd Frozen Vector Runs 2026-11-21](bittyd-frozen-vector-runs-2026-11-21.md) +- [bittyd Exit-Code Matrix 2026-11-19](bittyd-exit-code-matrix-2026-11-19.md) +- [bittyd No-TCP, Lifecycle, and Plugin-Denial Record 2026-11-20](bittyd-no-tcp-lifecycle-2026-11-20.md) +- [bittyd AC-022 Live Ctl Cells 2026-11-22](bittyd-ac022-live-ctl-2026-11-22.md) +- [P0 acceptance criteria](../p0-acceptance-criteria.md) +- [Evidence matrix](../evidence-matrix.md) +- [Risk register](../risk-register.md) +- [bittyd P0 evidence plan](../bittyd-p0-evidence-plan.md) +- [Threat model](../threat-model.md) +- [Security overview](../overview.md) diff --git a/docs/security/evidence-matrix.md b/docs/security/evidence-matrix.md index 18d2001..7225fd5 100644 --- a/docs/security/evidence-matrix.md +++ b/docs/security/evidence-matrix.md @@ -181,16 +181,16 @@ those suites are `presence` in the component tier, `absent` at the P0 real-service tier. The full proof obligations are in the [bittyd P0 evidence plan](bittyd-p0-evidence-plan.md). -| ID | Linked P0-AC | Precursor at `bitty` `6d0b6c65` | Required P0 producer | State | Remaining gap | -| ----- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| DR-01 | P0-AC-022, P0-AC-024 | `presence` `--test leases` token and control-relation cases; `--test peer` `captures_and_rechecks_a_child_process_peer` | `C-09`, `C-16`, `C-19` real-service driver plus the Agent read-only audit | `Open` | Live endpoint, handshake, operator-capability mint and consume, and session scope checks observed at `bitty` `9d0e8a88`, re-observed with the 15 × 51 scope matrix at `a8abf31c`; the Lua `connect()` denial and the plugin-host filesystem and network denials are executed at `e630e89a` in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md) (cells 9a/10a); the Agent read-only adapter audit and independent review remain absent | -| DR-02 | P0-AC-021, P0-AC-022 | `presence` `--test endpoint` owner-private, second-instance, symlink, and reattest cases; `--test peer` foreign-namespace refusal | `V-25`, `V-26`, `V-28`, `C-02`, `C-16` real-service driver | `Open` | Bound Unix endpoint and same-uid peer exchange observed at `9d0e8a88`; the second-uid cell is unrun on this host (no second account, no passwordless sudo); the daemon's own namespace table reads zero TCP rows in eight lifecycle phases at `e630e89a` with a control that reports a row when one exists (cells 6/6a in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md)); the `V-28` no-TCP row pass and `V-26`'s live tamper exit `6` are recorded at `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md), which keeps the harness rows' typed skips and reports the fd-scan half of `V-28` as blind for the non-dumpable daemon; the second-uid cell and independent review remain absent | -| DR-03 | P0-AC-022, P0-AC-024 | `presence` `--test leases` claim, transfer, detach, and revocation cases; `--test events` transfer and stopping control frames | `C-09`, `C-10`, `C-11`, `C-19` real-service driver | `Open` | Scope evaluation, observer grants, `ControllerRequired` refusals, and idempotent detach observed at `9d0e8a88`; the transfer, grant-revoke, and heartbeat cells are now observed live at `a8abf31c` (`C-06`, `C-11`, `C-26`, `C-27`, `C-28`, `V-38`), so `C-10` (injected clock) and independent review are what remain; the live attach, observer-refusal, detach, abort, and stop-mode arms are re-observed at `e630e89a` in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md) | -| DR-04 | P0-AC-026 | `presence` `--test audit` content-free record and digest cases; `--test idempotency` `a_conflict_never_prints_the_raw_key` | `C-07`, `C-14` real-service driver plus the seeded-secret scan | `Open` | `0700` directory, `0600` segment, content-free records, and bearer absence observed at `9d0e8a88`; the seeded-secret corpus, crash output, and `C-07`/`C-14` artifacts absent | -| DR-05 | P0-AC-021, P0-AC-022 | `presence` `--test limits` handshake advertisement; `--test binary` `no_arguments_reports_the_seam_and_creates_no_endpoint`; `--test endpoint` override cases | `V-01`, `V-02`, `C-09` real-service driver plus platform refusal | `Open` | Service API 1.5 advertised with an immutable capability set and typed refusals observed at `9d0e8a88`; the Windows named-pipe and non-Linux cells and `V-01`/`V-02` are unrun | -| DR-06 | P0-AC-023 | `presence` `--test orphan_journal` exact-identity, missing-pid, reused-pid, and owner-private cases | `C-03`, `C-13` real-service driver plus crash injection | `Open` | cgroup v2 containment (`claim: swept`), the cleanup sweep, and force-stop observed at `9d0e8a88`; crash injection `C-03` and the pid-reuse cases are unrun | -| DR-07 | P0-AC-023 | `presence` `--test leases` token redaction; `--test audit` no-content-field cases | `C-12` real-service driver plus the child `environ` and `/proc/self/fd` probe | `Open` | A live worker was swept on abort and stop; the child `environ` and `/proc/self/fd` capture is now recorded at `631f1f9c` by the 2026-11-16 child-scope record, but the `--test leases`/`--test audit` cells it also cites are not re-run there and `C-12` remains absent | -| DR-08 | P0-AC-019, P0-AC-021 | `presence` `--test binary` seam and no-endpoint cases; existing `bitty` safe-mode CLI matrix | `C-08`, `V-28` plus the safe-mode/headless matrix re-run | `Open` | The non-daemon half of this row's matrix is now recorded at `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md): `C-08`'s plain invocation (`endpoint: none bound`, exit `0`, no runtime subtree), `V-28`'s row pass, and `bitty --safe --headless` / `bitty --headless` runs that bind no daemon endpoint and hold zero TCP-socket descriptors by a live descriptor-table join; a daemon campaign still cannot prove daemon absence, so the row stays `Open` with the hostile-fixture threshold (`P0-AC-019`, F-5), the CI invocation mode, and independent review owed | +| ID | Linked P0-AC | Precursor at `bitty` `6d0b6c65` | Required P0 producer | State | Remaining gap | +| ----- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| DR-01 | P0-AC-022, P0-AC-024 | `presence` `--test leases` token and control-relation cases; `--test peer` `captures_and_rechecks_a_child_process_peer` | `C-09`, `C-16`, `C-19` real-service driver plus the Agent read-only audit | `Open` | Live endpoint, handshake, operator-capability mint and consume, and session scope checks observed at `bitty` `9d0e8a88`, re-observed with the 15 × 51 scope matrix at `a8abf31c`; the Lua `connect()` denial and the plugin-host filesystem and network denials are executed at `e630e89a` in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md) (cells 9a/10a); the Agent read-only adapter audit and independent review remain absent | +| DR-02 | P0-AC-021, P0-AC-022 | `presence` `--test endpoint` owner-private, second-instance, symlink, and reattest cases; `--test peer` foreign-namespace refusal | `V-25`, `V-26`, `V-28`, `C-02`, `C-16` real-service driver | `Open` | Bound Unix endpoint and same-uid peer exchange observed at `9d0e8a88`; the second-uid cell is unrun on this host (no second account, no passwordless sudo); the daemon's own namespace table reads zero TCP rows in eight lifecycle phases at `e630e89a` with a control that reports a row when one exists (cells 6/6a in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md)); the `V-28` no-TCP row pass and `V-26`'s live tamper exit `6` are recorded at `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md), which keeps the harness rows' typed skips and reports the fd-scan half of `V-28` as blind for the non-dumpable daemon; the replaced-inode and symlink variants of the tamper exit are recorded at `48f297d9` by the [2026-11-22 V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md), each observed serving before the tamper and exiting `6` with the single tamper line, with the socket path left in place because the shutdown identity check refuses to unlink an object the daemon did not bind; the owner-change variant, the second-uid cell, and independent review remain absent | +| DR-03 | P0-AC-022, P0-AC-024 | `presence` `--test leases` claim, transfer, detach, and revocation cases; `--test events` transfer and stopping control frames | `C-09`, `C-10`, `C-11`, `C-19` real-service driver | `Open` | Scope evaluation, observer grants, `ControllerRequired` refusals, and idempotent detach observed at `9d0e8a88`; the transfer, grant-revoke, and heartbeat cells are now observed live at `a8abf31c` (`C-06`, `C-11`, `C-26`, `C-27`, `C-28`, `V-38`), so `C-10` (injected clock) and independent review are what remain; the live attach, observer-refusal, detach, abort, and stop-mode arms are re-observed at `e630e89a` in the [2026-11-20 record](audits/bittyd-no-tcp-lifecycle-2026-11-20.md) | +| DR-04 | P0-AC-026 | `presence` `--test audit` content-free record and digest cases; `--test idempotency` `a_conflict_never_prints_the_raw_key` | `C-07`, `C-14` real-service driver plus the seeded-secret scan | `Open` | `0700` directory, `0600` segment, content-free records, and bearer absence observed at `9d0e8a88`; the seeded-secret corpus, crash output, and `C-07`/`C-14` artifacts absent | +| DR-05 | P0-AC-021, P0-AC-022 | `presence` `--test limits` handshake advertisement; `--test binary` `no_arguments_reports_the_seam_and_creates_no_endpoint`; `--test endpoint` override cases | `V-01`, `V-02`, `C-09` real-service driver plus platform refusal | `Open` | Service API 1.5 advertised with an immutable capability set and typed refusals observed at `9d0e8a88`; the Windows named-pipe and non-Linux cells and `V-01`/`V-02` are unrun | +| DR-06 | P0-AC-023 | `presence` `--test orphan_journal` exact-identity, missing-pid, reused-pid, and owner-private cases | `C-03`, `C-13` real-service driver plus crash injection | `Open` | cgroup v2 containment (`claim: swept`), the cleanup sweep, and force-stop observed at `9d0e8a88`; crash injection `C-03` and the pid-reuse cases are unrun | +| DR-07 | P0-AC-023 | `presence` `--test leases` token redaction; `--test audit` no-content-field cases | `C-12` real-service driver plus the child `environ` and `/proc/self/fd` probe | `Open` | A live worker was swept on abort and stop; the child `environ` and `/proc/self/fd` capture is now recorded at `631f1f9c` by the 2026-11-16 child-scope record, but the `--test leases`/`--test audit` cells it also cites are not re-run there and `C-12` remains absent | +| DR-08 | P0-AC-019, P0-AC-021 | `presence` `--test binary` seam and no-endpoint cases; existing `bitty` safe-mode CLI matrix | `C-08`, `V-28` plus the safe-mode/headless matrix re-run | `Open` | The non-daemon half of this row's matrix is now recorded at `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md): `C-08`'s plain invocation (`endpoint: none bound`, exit `0`, no runtime subtree), `V-28`'s row pass, and `bitty --safe --headless` / `bitty --headless` runs that bind no daemon endpoint and hold zero TCP-socket descriptors by a live descriptor-table join; a daemon campaign still cannot prove daemon absence, so the row stays `Open` with the hostile-fixture threshold (`P0-AC-019`, F-5), the CI invocation mode, and independent review owed | The precursor names are presence evidence only. A fake-server result, a component unit test, or a cross-compiled build never satisfies a `DR-*` row. @@ -440,9 +440,9 @@ walks the full 15 × 51 authorization matrix, and drives three headless `bitty --test-mode` instances with the built `bitty ctl` client at three different elevation allowlists. -| Criterion | Status (2026-11-16) | Record section | What the record supplies | Residual cell | -| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `P0-AC-022` | Partially verified | `C1: the scope-by-method matrix`; `C2: the terminal-instance ctl cells`; `C3–C6: the live daemon cells` | 765 authorization cells with 51 allowed and 714 `Denied/ScopeDenied`, one allowed cell per method; the real-service row is 68 pass, 0 fail, 18 typed skips of 86 at this revision; `session.resize` allow/deny/follow-the-lease, `session.control.transfer` allow/observer-deny/stale-token, `session.grant.revoke` allow/observer-deny/revoked-grant-cannot-attach/idempotent-repeat, and `lease.heartbeat` allow/foreign-deny/unknown-deny; the terminal instance denies `terminal spawn`, `terminal close`, `workspace close`, and `config reload` with exit `7` and `Denied/ScopeDenied`, and each one-scope allowlist moves only its own scope | Independent review; the arbitrary single-scope live grant (`C-09` `deferred`, bitty#2917); the MCP/Agent adapter audit; a live `ctl window new` (the headless loop has no app thread); live `terminal send`/`terminal text`; second-uid and Windows cells | +| Criterion | Status (2026-11-16) | Record section | What the record supplies | Residual cell | +| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `P0-AC-022` | Partially verified | `C1: the scope-by-method matrix`; `C2: the terminal-instance ctl cells`; `C3–C6: the live daemon cells` | 765 authorization cells with 51 allowed and 714 `Denied/ScopeDenied`, one allowed cell per method; the real-service row is 68 pass, 0 fail, 18 typed skips of 86 at this revision; `session.resize` allow/deny/follow-the-lease, `session.control.transfer` allow/observer-deny/stale-token, `session.grant.revoke` allow/observer-deny/revoked-grant-cannot-attach/idempotent-repeat, and `lease.heartbeat` allow/foreign-deny/unknown-deny; the terminal instance denies `terminal spawn`, `terminal close`, `workspace close`, and `config reload` with exit `7` and `Denied/ScopeDenied`, and each one-scope allowlist moves only its own scope | Independent review; the arbitrary single-scope live grant (`C-09` `deferred`, bitty#2917); the MCP/Agent adapter audit; a live `ctl window new` (the headless loop has no app thread; the [2026-11-22 live ctl record](audits/bittyd-ac022-live-ctl-2026-11-22.md) re-observes the exit `6` `Unavailable` and leaves the app-threaded allow cell a typed skip); live `terminal send`/`terminal text` are now recorded by that record; second-uid and Windows cells | The record closes the four residual cells the 2026-11-13 table names and leaves the criterion Partially verified for the same reason every other row is: the @@ -534,10 +534,28 @@ bytes, SHA-256 `05373147…`, and the `test-seams` recipe build `37780976` bytes, SHA-256 `73bb2ac1…` (test-only, never a shipped binary). Every run used a throwaway `0700` runtime root. -| Criterion | Status (2026-11-21) | Record section | What the record supplies | Residual cell | -| ------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `P0-AC-021` | Partially verified; `V-26`/`V-28` recorded runs added, second-uid cell **NOT EXERCISED** | `Cells 2 and 2a`; `Cell 3` | The frozen `bitty#2605` driver is green at the head in both recipe forms (real suite `68 pass / 18 skip` plain, `70 pass / 16 skip` under `test-seams`, `0 fail`, parity `48` compared with `0` divergences); `V-28`'s row pass recorded — served `unix_socket` endpoint kind, 32-hex `daemon_instance_id`, `daemon_state: running` — with the harness's `no_tcp_listener` fd-scan half demonstrated blind for the non-dumpable daemon (`/proc//fd` `EACCES` from parent and sibling, dumpable control reads, `/proc//net/tcp{,6}` readable); `V-26`'s fail-closed exit constructed live: the `0600` endpoint observed served over the real endpoint (`daemon.negotiate` ok, `daemon.status` `running`, `tcp_listeners=0`), `chmod 0666`, daemon exit `6` at `5.28 s` with the single tamper line and the socket path removed | Second-uid containment run (`V-25` stays a typed skip; no second account, no passwordless sudo); the owner-change, replaced-inode, and symlink tamper variants of `V-26`; the privileged `/proc//fd` listing of the daemon; `V-27` and every Windows cell; independent review | -| `DR-08` (intake row, `P0-AC-019` adjacent) | Non-daemon half recorded; the row stays `Open` | `Cells 4–6` | `C-08`'s plain invocation quoted from a standalone run (`ipc service: wired`, `endpoint: none bound (no socket file created)`, exit `0`, no runtime subtree created); `bitty --safe --headless` and `bitty --headless` exit `0` with the headless smoke ok, zero TCP-socket descriptors by a live descriptor-table join against `/proc/net/tcp{,6}` (the terminal process is dumpable, so the read is a measurement, not a refusal), no daemon endpoint, operator file, orphan journal, or `bitty` runtime subtree, and no surviving child | The hostile-fixture threshold `P0-AC-019` names (F-5) and its auditor review; the CI invocation mode (hosted runner); the formal producers and independent review | +| Criterion | Status (2026-11-21) | Record section | What the record supplies | Residual cell | +| ------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `P0-AC-021` | Partially verified; `V-26`/`V-28` recorded runs added, second-uid cell **NOT EXERCISED** | `Cells 2 and 2a`; `Cell 3` | The frozen `bitty#2605` driver is green at the head in both recipe forms (real suite `68 pass / 18 skip` plain, `70 pass / 16 skip` under `test-seams`, `0 fail`, parity `48` compared with `0` divergences); `V-28`'s row pass recorded — served `unix_socket` endpoint kind, 32-hex `daemon_instance_id`, `daemon_state: running` — with the harness's `no_tcp_listener` fd-scan half demonstrated blind for the non-dumpable daemon (`/proc//fd` `EACCES` from parent and sibling, dumpable control reads, `/proc//net/tcp{,6}` readable); `V-26`'s fail-closed exit constructed live: the `0600` endpoint observed served over the real endpoint (`daemon.negotiate` ok, `daemon.status` `running`, `tcp_listeners=0`), `chmod 0666`, daemon exit `6` at `5.28 s` with the single tamper line and the socket path removed | Second-uid containment run (`V-25` stays a typed skip; no second account, no passwordless sudo); the owner-change variant of `V-26` (the replaced-inode and symlink variants are recorded at `48f297d9` by the [2026-11-22 V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md)); the privileged `/proc//fd` listing of the daemon; `V-27` and every Windows cell; independent review | +| `DR-08` (intake row, `P0-AC-019` adjacent) | Non-daemon half recorded; the row stays `Open` | `Cells 4–6` | `C-08`'s plain invocation quoted from a standalone run (`ipc service: wired`, `endpoint: none bound (no socket file created)`, exit `0`, no runtime subtree created); `bitty --safe --headless` and `bitty --headless` exit `0` with the headless smoke ok, zero TCP-socket descriptors by a live descriptor-table join against `/proc/net/tcp{,6}` (the terminal process is dumpable, so the read is a measurement, not a refusal), no daemon endpoint, operator file, orphan journal, or `bitty` runtime subtree, and no surviving child | The hostile-fixture threshold `P0-AC-019` names (F-5) and its auditor review; the CI invocation mode (hosted runner); the formal producers and independent review | + +### 2026-11-22 V-26 tamper-variant and AC-022 live-ctl campaign + +Two records at `bitty` `48f297d9` (workspace version `0.0.47`, the same +detached-checkout discipline as the campaigns above; the shared workspace +checkout stayed read-only), built by the frozen driver's own test invocation +into a target directory outside every repository; the plain-form driver +binary `37734752` bytes, SHA-256 `3ce1b84d…`, the `test-seams` recipe build +`37780960` bytes, SHA-256 `802b9dbd…` (test-only, never a shipped binary), +and the terminal binary `612811784` bytes, SHA-256 `61572b6a…`. Every run +used a throwaway `0700` runtime root; only PIDs the records started were +touched, and the owner's live daemon row was listed before and after each +campaign, unchanged. + +| Criterion | Status (2026-11-22) | Record section | What the record supplies | Residual cell | +| ----------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `P0-AC-021` | Partially verified; replaced-inode and symlink tamper variants constructed, second-uid cell **NOT EXERCISED** | `Cells 2 and 3` of the [V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md) | The frozen driver green at the head in both recipe forms (`68 pass / 18 skip` plain, `70 pass / 16 skip` under `test-seams`, `0 fail`, parity `48` compared, `0` divergences), the `V-26` harness row keeping its `requires-tamper-seam` typed skip; the replaced-inode variant observed live — the `0600` endpoint served over the real endpoint first (`daemon.negotiate` ok, `daemon.status` `running`, `tcp_listeners=0`), the bound socket renamed away, a plain file planted at the path, daemon exit `6` at `5.26 s` with the single tamper line on stderr; the symlink variant observed live the same way with the symlink pointing at the renamed live socket — and, differing from the mode variant and recorded as observed, the socket path **not** removed on either exit because the shutdown identity check refuses to unlink an object the daemon did not bind, so the planted artifact and the renamed socket file survive while refusing connections | The owner-change variant of `V-26` (needs privilege; typed skip, never attempted); second-uid containment run (`V-25` stays a typed skip; no second account, no passwordless sudo); the privileged `/proc//fd` listing of the daemon; `V-27` and every Windows cell; independent review | +| `P0-AC-022` | Partially verified; live `terminal send`/`terminal text` verbs added; the window-new allow cell stays a typed skip | `The cells` of the [live ctl record](audits/bittyd-ac022-live-ctl-2026-11-22.md) | A live `ctl terminal send` over a served instance socket — allowed under the CLI default grant, exit `0`, the untrusted-output notice carried; a live `ctl terminal text` — allowed, exit `0`, with the line sent by the previous verb observable in the read-back grid, so the allow rows are not vacuous; a scope-gate control on the same connection class (`terminal spawn`) denied with exit `7`, `Denied/ScopeDenied`, naming `terminal.manage`; `ctl window new` recorded exactly as answered on the headless servo — the `view.manage` gate passed, the request offered into the bounded lane, exit `6` `Unavailable`, nothing created — and not counted as the allow cell | A live `ctl window new` on an app-threaded served surface (typed skip: needs a windowed instance; the host compositor is out of scope by the workspace GUI-testing ban and no nested/virtual display exists on the host); the CLI-shaped deny arms of `terminal send`/`terminal text` are unconstructible at this revision (union-only elevation), the non-CLI profiles belong to the adapter audit; independent review; `C-09` (bitty#2917); second-uid and Windows cells | ### Residual cells @@ -583,15 +601,25 @@ a throwaway `0700` runtime root. observation until a real DevTools endpoint exists. - **`P0-AC-026` export and crash paths absent.** Trace export preview equality, a crash-report path, and a seeded-secret corpus are still unexercised. -- **`P0-AC-022` matrix and live cells: observed 2026-11-16, review unrun.** The +- **`P0-AC-022` matrix and live cells: observed 2026-11-16, live ctl verbs + added 2026-11-22, review unrun.** The [2026-11-16 record](audits/bittyd-ac022-scopes-2026-11-16.md) supplies the 15 × 51 [matrix artifact](audits/ac022-scope-matrix-2026-11-16.md), the terminal-instance elevation cells, and the live `session.resize`, `session.control.transfer`, `session.grant.revoke`, and `lease.heartbeat` - arms at `bitty` `a8abf31c`. What remains is the independent review, the - arbitrary single-scope live grant that `C-09` defers to bitty#2917, the - MCP/Agent adapter audit, a live `ctl window new` on a served surface, and the - second-uid and Windows cells. + arms at `bitty` `a8abf31c`; the + [2026-11-22 live ctl record](audits/bittyd-ac022-live-ctl-2026-11-22.md) + adds the previously unexercised terminal-instance verbs at `bitty` + `48f297d9`: a live `terminal send` and a live `terminal text`, both allowed + under the CLI default grant with the sent line observable in the read-back + grid and the untrusted-observation notice carried on both replies, plus a + scope-gate control denied `Denied/ScopeDenied` for `terminal.manage`. What + remains is the independent review, the arbitrary single-scope live grant + that `C-09` defers to bitty#2917, the MCP/Agent adapter audit, a live + `ctl window new` on an app-threaded served surface (the 2026-11-22 record + re-observes the headless exit `6` `Unavailable` and declares that allow + cell a typed skip: constructing it needs a windowed instance and no display + is in scope on this host), and the second-uid and Windows cells. - **Independent review: agent tier recorded, owner sign-off still owed.** The [2026-11-21 review](audits/bittyd-p0-independent-review-2026-11-21.md) is the first independent-review artifact for the covered cells — a fresh diff --git a/docs/security/p0-acceptance-criteria.md b/docs/security/p0-acceptance-criteria.md index a1caf5f..b40fc6d 100644 --- a/docs/security/p0-acceptance-criteria.md +++ b/docs/security/p0-acceptance-criteria.md @@ -793,16 +793,23 @@ verification method names stays owed. The driver in both recipe forms and records `V-28`'s row pass, `V-26`'s live tamper-exit `6` behind a served daemon, `C-08`'s plain invocation, and the safe-mode/headless absence matrix, keeping every typed skip a skip and -flipping no criterion. - -| Criterion | 2026-11-08 | 2026-11-13 / 2026-11-16 (latest per criterion) | Evidence the current record supplies | Residual cells | -| --------- | ----------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| P0-AC-021 | Verified (Linux x86_64) | Partially verified | `P0-AC-021 endpoint modes and the external no-TCP scan`: directory `0700`, socket, lock, and operator file `0600`, zero per-PID `ss` rows in the attached-session snapshot, no internet socket in `lsof`, no new global listener, `tcp_listeners: 0`, and a same-uid handshake against the live endpoint; the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md) adds the scoping note's recorded runs at `0bdb6d1c`: the frozen driver green in both recipe forms, `V-28`'s row pass (served `unix_socket` endpoint kind, 32-hex `daemon_instance_id`, `daemon_state: running`; the harness's fd-scan half demonstrated blind for the non-dumpable daemon), and `V-26`'s fail-closed exit `6` constructed live behind a running daemon observed serving first (`chmod 0666` on the `0600` socket, exit `6` at `5.28 s`, the single tamper line, the socket path removed), with the harness row kept as a typed skip | Foreign-user denial at the peer check: needs a second local account, and this environment has no passwordless `sudo`, so that cell is unrun and unclaimed (`V-25` stays a typed skip); the `0700`/`0600` mode denial against a foreign kernel uid is reproduced in the 2026-11-15 record; the owner-change, replaced-inode, and symlink variants of `V-26`'s tamper exit are not constructed; descriptor table unreadable; Windows named pipe (`V-27` stays a typed skip) and non-Linux cells; independent review | -| P0-AC-022 | Partially verified | Partially verified | `C1`–`C6` of the [2026-11-16 `P0-AC-022` record](audits/bittyd-ac022-scopes-2026-11-16.md): the 15-scope by 51-method [matrix](audits/ac022-scope-matrix-2026-11-16.md) holds 765 cells with 51 allowed and 714 `Denied/ScopeDenied`; the real-service row is 68 pass, 0 fail, 18 typed skips of 86 at `a8abf31c`; `session.resize`, `session.control.transfer`, `session.grant.revoke`, and `lease.heartbeat` each have their allow and deny arms observed; a headless `bitty --test-mode` instance denies `terminal spawn`, `terminal close`, `workspace close`, and `config reload` with exit `7` and `Denied/ScopeDenied` while every one-scope `BITTY_CTL_ELEVATE` allowlist moves only its own scope; the earlier live lifecycle cells (observer `ControllerRequired`, no observer `control_token`, idempotent detach) still stand | Independent review; the arbitrary single-scope live grant (`C-09` `deferred`, bitty#2917); the MCP/Agent adapter audit; a live `ctl window new` on a served surface; live `terminal send`/`terminal text` over the socket; second-uid and Windows cells | -| P0-AC-023 | Partially verified | Partially verified | `The child environment as the child itself sees it` and `The child descriptor table` in the [2026-11-16 child-scope record](audits/bittyd-child-scope-2026-11-16.md): the child's own `/proc//environ` is the supplied `env` plus `TERM=xterm-256color` and nothing else, with no `BITTY*`, `SSH_AUTH_SOCK`, `AWS_*`, token, secret, password, bearer, `control_token`, or `operator_capability`; the child's own `/proc//fd` is descriptors `0`, `1`, `2` on one `/dev/pts/N`; a same-uid ancestor's `ls -ln` agrees; bitty#2824's fd-table test and bitty#2823's close-range test both pass at `631f1f9c` | Child-scope expiry on a path that mints a child token (`worker_sessions: false`, `d01-amendment-required`); an SSH agent-forwarding run; a worker-kind session; second-uid foreign-access denial (needs privilege); independent review | -| P0-AC-024 | Not verified | Partially verified | `A1`–`A4` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): the Agent/MCP default over all 51 frozen methods is 10 allowed and 41 `Denied/ScopeDenied`; the daemon baseline is three `session.*` scopes with no `session.host` and no `daemon.*`; the untrusted label is decided by `carries_terminal_content()` (`session.read` only), is single-valued, and overwrites a forged field; live, a controlled read carries `is_untrusted_surface: true` on a zero-byte read, a fresh consumer gets `ConsentRequired` for create, `ScopeViolation` for kill, and the uniform `NotFound` for target-addressed content verbs, and an observer read/write is still `Denied/ControllerRequired`; `A`–`D` of the [2026-11-16 adapter audit](audits/bittyd-ac024-adapter-audit-2026-11-16.md): every imported MCP tool is `read_only = true` by construction with only `name`/`description`/`inputSchema` read from the server, the `inspect` tier refuses a mutating import before the authorizer and before consent with zero transport contact, the label has no wire representation (the bus sets it, a pre-contact refusal stays `false`, and a persisted row missing it is refused as corrupt), tool output reaches the model as a tool-role message under a host-generated header and a length-prefixed fence with Zone 1 refusing untrusted markers fail-closed, and one adapter cannot dispatch another server's tool or re-target a connection — with the adapter's consent principal found shape-validated but not identity-bound | The auditor review of instruction/data channel separation that the criterion names; confused-deputy suite; the filesystem/network non-combination half (no such plane on `bittyd`) | -| P0-AC-025 | Partially verified | Partially verified | `B1`–`B4` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): the eight frozen `debug.*` verbs walk all fifteen scopes (120 cells, 8 allowed, 112 `Denied/ScopeDenied`); no service scope name is a v1 scope and no `debug.*` name is a service method; a live handshake advertises `session.inspect session.attach session.control terminal.inspect terminal.input terminal.manage process.spawn` and no `debug.*`/`view.*`/`config.*`/`plugin.*`/`ai.*` scope; `debug.inspect`, `debug.trace`, `debug.control`, `debug.snapshot`, and `debug.break` are `NotFound/NotFound` for both consumer and operator | Live DevTools endpoint and client; formal DevTools scope audit; a granted-but-unserved `debug.*` arm (no granting path exists on this surface) | -| P0-AC-026 | Partially verified | Partially verified | `C1`–`C3` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): a six-shape seeded corpus driven through `AuditSink::record` → `render_record` → `AuditWriter::append_line` renders only the opaque digest, with no full seed and no 6-byte window of one; the line is `render_record`'s bytes with a closed 26-key vocabulary whose values admit no path, whitespace, or free text; the live audit directory is `0700` with a `0600` segment of nine records and no seeded value from `terminal_id`, argv, `env`, `cwd`, the idempotency key, or the client correlation | Trace/export preview equality; crash-report scan; input-recording and clipboard defaults (no such surface is served); formal trace-minimization audit | +flipping no criterion. Two further dated records at `bitty` `48f297d9` — the +[2026-11-22 V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md) +and the [2026-11-22 AC-022 live ctl +record](audits/bittyd-ac022-live-ctl-2026-11-22.md) — construct the +replaced-inode and symlink tamper variants behind served daemons and drive +the live `terminal send`/`terminal text` verbs, recording the headless +`ctl window new` refusal as observed and keeping its app-threaded allow cell +a typed skip; they too flip no criterion. + +| Criterion | 2026-11-08 | 2026-11-13 / 2026-11-16 (latest per criterion) | Evidence the current record supplies | Residual cells | +| --------- | ----------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| P0-AC-021 | Verified (Linux x86_64) | Partially verified | `P0-AC-021 endpoint modes and the external no-TCP scan`: directory `0700`, socket, lock, and operator file `0600`, zero per-PID `ss` rows in the attached-session snapshot, no internet socket in `lsof`, no new global listener, `tcp_listeners: 0`, and a same-uid handshake against the live endpoint; the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md) adds the scoping note's recorded runs at `0bdb6d1c`: the frozen driver green in both recipe forms, `V-28`'s row pass (served `unix_socket` endpoint kind, 32-hex `daemon_instance_id`, `daemon_state: running`; the harness's fd-scan half demonstrated blind for the non-dumpable daemon), and `V-26`'s fail-closed exit `6` constructed live behind a running daemon observed serving first (`chmod 0666` on the `0600` socket, exit `6` at `5.28 s`, the single tamper line, the socket path removed), with the harness row kept as a typed skip; the [2026-11-22 V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md) adds the two same-uid variants of the same exit at `48f297d9`: the replaced-inode variant (the bound socket renamed away, a plain file planted at the path) and the symlink variant (the path replaced by a symlink to the renamed live socket), each observed serving over the real endpoint first and each exiting `6` at `5.26 s` with the single tamper line, with the socket path not removed on either exit because the shutdown identity check refuses to unlink an object the daemon did not bind | Foreign-user denial at the peer check: needs a second local account, and this environment has no passwordless `sudo`, so that cell is unrun and unclaimed (`V-25` stays a typed skip); the `0700`/`0600` mode denial against a foreign kernel uid is reproduced in the 2026-11-15 record; the owner-change variant of `V-26`'s tamper exit is not constructed (needs privilege; the replaced-inode and symlink variants are recorded by the 2026-11-22 variant record); descriptor table unreadable; Windows named pipe (`V-27` stays a typed skip) and non-Linux cells; independent review | +| P0-AC-022 | Partially verified | Partially verified | `C1`–`C6` of the [2026-11-16 `P0-AC-022` record](audits/bittyd-ac022-scopes-2026-11-16.md): the 15-scope by 51-method [matrix](audits/ac022-scope-matrix-2026-11-16.md) holds 765 cells with 51 allowed and 714 `Denied/ScopeDenied`; the real-service row is 68 pass, 0 fail, 18 typed skips of 86 at `a8abf31c`; `session.resize`, `session.control.transfer`, `session.grant.revoke`, and `lease.heartbeat` each have their allow and deny arms observed; a headless `bitty --test-mode` instance denies `terminal spawn`, `terminal close`, `workspace close`, and `config reload` with exit `7` and `Denied/ScopeDenied` while every one-scope `BITTY_CTL_ELEVATE` allowlist moves only its own scope; the earlier live lifecycle cells (observer `ControllerRequired`, no observer `control_token`, idempotent detach) still stand; the [2026-11-22 live ctl record](audits/bittyd-ac022-live-ctl-2026-11-22.md) adds the previously unexercised terminal-instance verbs at `48f297d9`: a live `ctl terminal send` and a live `ctl terminal text` over a served instance socket, both allowed under the CLI default grant (exit `0`) with the sent line observable in the read-back grid and the untrusted-observation notice on both replies, a scope-gate control on the same connection class denied exit `7` `Denied/ScopeDenied` naming `terminal.manage`, and `ctl window new` recorded exactly as the headless servo answers it (the `view.manage` gate passed, the request offered into the bounded lane, exit `6` `Unavailable`, nothing created) | Independent review; the arbitrary single-scope live grant (`C-09` `deferred`, bitty#2917); the MCP/Agent adapter audit; a live `ctl window new` on an app-threaded served surface (typed skip on this host: constructing it needs a windowed instance and the host compositor is out of scope by the workspace GUI-testing ban, with no nested or virtual display available); the CLI-shaped deny arms of `terminal send`/`terminal text` are unconstructible at this revision (union-only elevation), with the non-CLI profiles owned by the adapter audit; second-uid and Windows cells | +| P0-AC-023 | Partially verified | Partially verified | `The child environment as the child itself sees it` and `The child descriptor table` in the [2026-11-16 child-scope record](audits/bittyd-child-scope-2026-11-16.md): the child's own `/proc//environ` is the supplied `env` plus `TERM=xterm-256color` and nothing else, with no `BITTY*`, `SSH_AUTH_SOCK`, `AWS_*`, token, secret, password, bearer, `control_token`, or `operator_capability`; the child's own `/proc//fd` is descriptors `0`, `1`, `2` on one `/dev/pts/N`; a same-uid ancestor's `ls -ln` agrees; bitty#2824's fd-table test and bitty#2823's close-range test both pass at `631f1f9c` | Child-scope expiry on a path that mints a child token (`worker_sessions: false`, `d01-amendment-required`); an SSH agent-forwarding run; a worker-kind session; second-uid foreign-access denial (needs privilege); independent review | +| P0-AC-024 | Not verified | Partially verified | `A1`–`A4` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): the Agent/MCP default over all 51 frozen methods is 10 allowed and 41 `Denied/ScopeDenied`; the daemon baseline is three `session.*` scopes with no `session.host` and no `daemon.*`; the untrusted label is decided by `carries_terminal_content()` (`session.read` only), is single-valued, and overwrites a forged field; live, a controlled read carries `is_untrusted_surface: true` on a zero-byte read, a fresh consumer gets `ConsentRequired` for create, `ScopeViolation` for kill, and the uniform `NotFound` for target-addressed content verbs, and an observer read/write is still `Denied/ControllerRequired`; `A`–`D` of the [2026-11-16 adapter audit](audits/bittyd-ac024-adapter-audit-2026-11-16.md): every imported MCP tool is `read_only = true` by construction with only `name`/`description`/`inputSchema` read from the server, the `inspect` tier refuses a mutating import before the authorizer and before consent with zero transport contact, the label has no wire representation (the bus sets it, a pre-contact refusal stays `false`, and a persisted row missing it is refused as corrupt), tool output reaches the model as a tool-role message under a host-generated header and a length-prefixed fence with Zone 1 refusing untrusted markers fail-closed, and one adapter cannot dispatch another server's tool or re-target a connection — with the adapter's consent principal found shape-validated but not identity-bound | The auditor review of instruction/data channel separation that the criterion names; confused-deputy suite; the filesystem/network non-combination half (no such plane on `bittyd`) | +| P0-AC-025 | Partially verified | Partially verified | `B1`–`B4` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): the eight frozen `debug.*` verbs walk all fifteen scopes (120 cells, 8 allowed, 112 `Denied/ScopeDenied`); no service scope name is a v1 scope and no `debug.*` name is a service method; a live handshake advertises `session.inspect session.attach session.control terminal.inspect terminal.input terminal.manage process.spawn` and no `debug.*`/`view.*`/`config.*`/`plugin.*`/`ai.*` scope; `debug.inspect`, `debug.trace`, `debug.control`, `debug.snapshot`, and `debug.break` are `NotFound/NotFound` for both consumer and operator | Live DevTools endpoint and client; formal DevTools scope audit; a granted-but-unserved `debug.*` arm (no granting path exists on this surface) | +| P0-AC-026 | Partially verified | Partially verified | `C1`–`C3` of the [2026-11-16 MCP/Agent record](audits/bittyd-ac024-026-2026-11-16.md): a six-shape seeded corpus driven through `AuditSink::record` → `render_record` → `AuditWriter::append_line` renders only the opaque digest, with no full seed and no 6-byte window of one; the line is `render_record`'s bytes with a closed 26-key vocabulary whose values admit no path, whitespace, or free text; the live audit directory is `0700` with a `0600` segment of nine records and no seeded value from `terminal_id`, argv, `env`, `cwd`, the idempotency key, or the client correlation | Trace/export preview equality; crash-report scan; input-recording and clipboard defaults (no such surface is served); formal trace-minimization audit | `P0-AC-019` keeps no campaign row here. The [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md) diff --git a/docs/security/risk-register.md b/docs/security/risk-register.md index 40615db..0dd1b96 100644 --- a/docs/security/risk-register.md +++ b/docs/security/risk-register.md @@ -185,16 +185,16 @@ code presence is not evidence. The producers and pending rows are in the -| ID | Risk | Severity | Likelihood | Stage | Contract controls | Existing risk | Required mitigation / exit evidence | State | -| ----- | ----------------------------------------------------------------------------------------------------------------------- | -------- | ---------- | ----- | ----------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -| DR-01 | A same-uid process or owner-run adapter crosses the operator intent gate and acts as daemon operator | Critical | High | P0 | D-07, D-08 | R-011, R-013 | Owner-private `0700`/`0600` capability rotated per boot, handshake-only, attributed mint/consume/revoke, plugin `connect()` denial, and an explicit statement that this is an intent gate, never an isolation boundary; `C-15`, `C-16`; no claim that the capability is hidden from the owner | Open | -| DR-02 | Endpoint impostor, tampered endpoint, inherited descriptor, or second instance crosses the local transport boundary | Critical | Medium | P0 | D-07, D-15 | R-011 | `0700` directory and `0600` socket or current-user pipe; peer capture before parsing; Linux per-message `SCM_CREDENTIALS`; captured-peer re-check before every privileged action; tamper detection exits `6`; single-instance lock; no TCP, abstract socket, or `/tmp` fallback; `V-25`, `V-26`, `V-28`, `C-02`, `C-16` | Open | -| DR-03 | A session scope, observer grant, or control-token bypass lets a client read, control, or kill another session | Critical | High | P0 | D-07, D-08 | R-011, R-013 | Deny-by-default additive `session.*` and `daemon.*`; `session.host` never baseline; create intersects host consent with `process.spawn`; single-use observer grant; 256-bit token rotated on claim/transfer; controller relation necessary and never sufficient; static no-oracle refusals; `C-09`, `C-10`, `C-11`, `C-19` | Open | -| DR-04 | Daemon audit, diagnostics, crash output, or idempotency state leaks a token, bearer, argv, env, or terminal content | Critical | High | P0 | D-08, D-16 | R-014 | Content-free audit fields, digest-only `terminal_id` and correlation, bounded UTF-8 strings, refusal budget and aggregation, `0700`/`0600` sink, rotation with bounded tail loss, redacted `Debug`, no core dumps, create keys treated as token-equivalent secrets; `C-07`, `C-14` | Open | -| DR-05 | Version or capability negotiation degrades to a weaker surface, or an unsupported cell falls back to a weaker transport | High | Medium | P0 | D-11, D-15 | R-011 | Two version axes with typed refusal before any operation; one major at a time; immutable capabilities; no probe downgrade or translated major; unsupported cell returns a typed result or no endpoint; no anonymous or weaker peer check; `V-01`, `V-02`, `C-09` | Open | -| DR-06 | Crash recovery reaps an unrelated process or a retry spawns a duplicate worker | Critical | Medium | P0 | D-06 | R-011, R-012 | Two-phase reserve/commit journal with fsync; cgroup v2 or pidfd-tracked subreaper containment identity; reserve before spawn; exact-match reap only; pid reuse, missing pid, and unverifiable records quarantined and never signalled; startup scan before endpoint bind; crash injection; `C-03`, `C-13` | Open | -| DR-07 | A spawned worker inherits a daemon descriptor, environment secret, control token, or operator capability | Critical | Medium | P0 | D-07 | R-012 | Explicit bounded child environment, never the daemon environment; every daemon descriptor closed before `exec` or close-on-exec, with the child `/proc/self/fd` scan as the proof; only the PTY slave on stdio; no control token, operator capability, host-grant bearer, or service token in the child; `C-12`. Both recorded defects are closed in code (bitty#2824 by bitty#2825; bitty#2823 by bitty#2825 and bitty#2847) per the [evidence plan](bittyd-p0-evidence-plan.md#evidence-summary), but the row stays `Open`: the fresh child descriptor and environment run is still owed, and the 2026-11-13 record did not re-run it. | Open | -| DR-08 | The daemon becomes a startup, diagnostics, or safe-mode dependency, or a hidden listener exists | High | Medium | P0 | D-01, D-05, D-15 | R-009, R-011 | `bitty --safe`, headless tests, CI, and a plain invocation work with no endpoint and no daemon process; no hidden listener; missing endpoint is a typed supported state; no TCP, abstract socket, or `/tmp` fallback; `C-08`, `V-28`, `P0-AC-019`. The non-daemon half is recorded at `bitty` `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md): `C-08`'s plain invocation, `V-28`'s row pass, and the `bitty --safe --headless`/`bitty --headless` runs, each binding no daemon endpoint and holding zero TCP-socket descriptors by a live descriptor-table join; the row stays `Open` because the hostile-fixture threshold (`P0-AC-019`, F-5), the CI invocation mode, and the independent review are still owed | Open | +| ID | Risk | Severity | Likelihood | Stage | Contract controls | Existing risk | Required mitigation / exit evidence | State | +| ----- | ----------------------------------------------------------------------------------------------------------------------- | -------- | ---------- | ----- | ----------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| DR-01 | A same-uid process or owner-run adapter crosses the operator intent gate and acts as daemon operator | Critical | High | P0 | D-07, D-08 | R-011, R-013 | Owner-private `0700`/`0600` capability rotated per boot, handshake-only, attributed mint/consume/revoke, plugin `connect()` denial, and an explicit statement that this is an intent gate, never an isolation boundary; `C-15`, `C-16`; no claim that the capability is hidden from the owner | Open | +| DR-02 | Endpoint impostor, tampered endpoint, inherited descriptor, or second instance crosses the local transport boundary | Critical | Medium | P0 | D-07, D-15 | R-011 | `0700` directory and `0600` socket or current-user pipe; peer capture before parsing; Linux per-message `SCM_CREDENTIALS`; captured-peer re-check before every privileged action; tamper detection exits `6`; single-instance lock; no TCP, abstract socket, or `/tmp` fallback; `V-25`, `V-26`, `V-28`, `C-02`, `C-16`. The mode variant of the `V-26` tamper exit is recorded live at `bitty` `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md) (daemon observed serving first, `chmod 0666`, exit `6`, the single tamper line, the socket path removed), and the replaced-inode and symlink variants are recorded live at `bitty` `48f297d9` by the [2026-11-22 V-26 variant record](audits/bittyd-v26-variants-2026-11-22.md): each daemon observed serving over the real endpoint first, then exiting `6` with the single tamper line within one re-attestation interval, with the socket path left in place because the shutdown identity check refuses to unlink an object the daemon did not bind; the row stays `Open` because the owner-change variant needs privilege, the second-uid cell is unrun on this host, and the independent review is still owed | Open | +| DR-03 | A session scope, observer grant, or control-token bypass lets a client read, control, or kill another session | Critical | High | P0 | D-07, D-08 | R-011, R-013 | Deny-by-default additive `session.*` and `daemon.*`; `session.host` never baseline; create intersects host consent with `process.spawn`; single-use observer grant; 256-bit token rotated on claim/transfer; controller relation necessary and never sufficient; static no-oracle refusals; `C-09`, `C-10`, `C-11`, `C-19` | Open | +| DR-04 | Daemon audit, diagnostics, crash output, or idempotency state leaks a token, bearer, argv, env, or terminal content | Critical | High | P0 | D-08, D-16 | R-014 | Content-free audit fields, digest-only `terminal_id` and correlation, bounded UTF-8 strings, refusal budget and aggregation, `0700`/`0600` sink, rotation with bounded tail loss, redacted `Debug`, no core dumps, create keys treated as token-equivalent secrets; `C-07`, `C-14` | Open | +| DR-05 | Version or capability negotiation degrades to a weaker surface, or an unsupported cell falls back to a weaker transport | High | Medium | P0 | D-11, D-15 | R-011 | Two version axes with typed refusal before any operation; one major at a time; immutable capabilities; no probe downgrade or translated major; unsupported cell returns a typed result or no endpoint; no anonymous or weaker peer check; `V-01`, `V-02`, `C-09` | Open | +| DR-06 | Crash recovery reaps an unrelated process or a retry spawns a duplicate worker | Critical | Medium | P0 | D-06 | R-011, R-012 | Two-phase reserve/commit journal with fsync; cgroup v2 or pidfd-tracked subreaper containment identity; reserve before spawn; exact-match reap only; pid reuse, missing pid, and unverifiable records quarantined and never signalled; startup scan before endpoint bind; crash injection; `C-03`, `C-13` | Open | +| DR-07 | A spawned worker inherits a daemon descriptor, environment secret, control token, or operator capability | Critical | Medium | P0 | D-07 | R-012 | Explicit bounded child environment, never the daemon environment; every daemon descriptor closed before `exec` or close-on-exec, with the child `/proc/self/fd` scan as the proof; only the PTY slave on stdio; no control token, operator capability, host-grant bearer, or service token in the child; `C-12`. Both recorded defects are closed in code (bitty#2824 by bitty#2825; bitty#2823 by bitty#2825 and bitty#2847) per the [evidence plan](bittyd-p0-evidence-plan.md#evidence-summary), but the row stays `Open`: the fresh child descriptor and environment run is still owed, and the 2026-11-13 record did not re-run it. | Open | +| DR-08 | The daemon becomes a startup, diagnostics, or safe-mode dependency, or a hidden listener exists | High | Medium | P0 | D-01, D-05, D-15 | R-009, R-011 | `bitty --safe`, headless tests, CI, and a plain invocation work with no endpoint and no daemon process; no hidden listener; missing endpoint is a typed supported state; no TCP, abstract socket, or `/tmp` fallback; `C-08`, `V-28`, `P0-AC-019`. The non-daemon half is recorded at `bitty` `0bdb6d1c` by the [2026-11-21 frozen-vector record](audits/bittyd-frozen-vector-runs-2026-11-21.md): `C-08`'s plain invocation, `V-28`'s row pass, and the `bitty --safe --headless`/`bitty --headless` runs, each binding no daemon endpoint and holding zero TCP-socket descriptors by a live descriptor-table join; the row stays `Open` because the hostile-fixture threshold (`P0-AC-019`, F-5), the CI invocation mode, and the independent review are still owed | Open |