Files
gbrain/test
421f892703 fix(security): three singleton P0s — whoami over stdio, auto_link_allow_remote opt-in, sync file-transport for trusted durability origin
Takeover of three community PRs, each repaired per adversarial review:

- #2376 (whoami/stdio): thread an MCP transport tag (stdio|http) through
  dispatch so whoami over the stdio pipe stops fail-closing with
  unknown_transport. Repair: return {transport:'stdio', scopes:[]} instead
  of the PR's {transport:'local', ...} — 'local' stays reserved for the
  trusted ctx.remote===false CLI surface so untrusted stdio callers can
  never masquerade as it. Auth-less HTTP still throws (fail-closed).

- #2478 (auto_link_allow_remote): default-deny opt-in config flag that lets
  remote MCP put_page callers run auto-link/timeline post-hooks on
  single-user brains with a trusted client. Repair: stripped the smuggled
  think/gather excerptLen 600→3000 behavior change; registered the key in
  KNOWN_CONFIG_KEYS; added the promised unit tests.

- #2709 (sync file transport): pullRepo gains a gated allowLocalFileOrigin
  opt-in that relaxes protocol.file.allow only when the resolved pull
  origin is a local path realpath-contained under GBRAIN_HOME (the
  durability bare repo). Repair: rebased the stale sync.ts hunk onto the
  current pullRepo(gitContextRoot) call site; network remotes and
  out-of-root local origins keep full SSRF hardening.

Co-authored-by: Facundo-Moreno-Dev <Facundo-Moreno-Dev@users.noreply.github.com>
Co-authored-by: onchito-walks <onchito-walks@users.noreply.github.com>
Co-authored-by: hunterbohm <hunterbohm@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:36:17 -07:00
..