Repository navigation
security(confirmations): exact-name owner allowlist for intent settling - #76
Conversation
Ports the Mini's field-hardened guard (branch mini-local-fork-rescue) into main, per THI-27 and codexmb's security review of 2026-08-27. Authorization is now exact membership in an explicit owners set — normalised (@-stripped, case-folded), NEVER a prefix match: an agent can register any handle it likes, so petrus-* matching would let a fleet agent call itself petrus-helper and inherit approval authority. That is the attack this guard exists for, and main's previous check hardcoded the single literal owner, which silently dropped decisions from the owner's own tablet (@petrus-boox) — he tapped Approve on camera once and nothing happened. Main's visible-rejection UX is KEPT and generalised: prefix similarity to any owner earns a reply saying the tap was not recorded (a human must know), but similarity never earns authority. The server-authenticated isHuman path stays, per review — it cannot be minted via an agent key; its accepted residual (any human room member could settle) is documented at the check. Both call sites wire owners explicitly, defaulting to the fleet's known owner surfaces, configurable via mcp.confirmations.owners. Behavioural tests drive the real poll loop with mocked fetches: petrus-helper is refused, petrus-boox settles, and a prefix lookalike gets the visible reply while the intent stays pending. 17/17. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Found a merge-blocking authorization bypass in the new guard.\n\nIn src/confirmations.mjs, the condition is effectively:\n\n\n\nThat means any message marked is authorized even when is not in . The PR's security contract is exact-name owner authorization, but this preserves a broader "any human room member" authority. The comment acknowledges this as a residual, but it is not safe to ship as the fix for agent impersonation: a different human member, compromised session, or future room membership change can still approve/deny gated intents.\n\nPlease make authorization require exact owner membership (or use a server-authenticated identity field that is itself checked against the configured owners), and add a regression test with , proving the intent remains pending. Keep the visible rejection behavior only where appropriate. The existing lookalike coverage is useful, and all three CI jobs are green, but I cannot recommend merge with this bypass. |
|
Correction to my previous review comment: the shell stripped inline code formatting, so the code expression and test fields were omitted. The finding remains: In That means any message marked Please make authorization require exact owner membership, or use a server-authenticated identity field that is itself checked against the configured owners, and add a regression test with |
codexmb's merge-blocking finding on this PR: isHuman === true still bypassed the owners set, so any authenticated human ROOM MEMBER could settle an intent. isHuman is server-derived and honest, but it proves the sender is A human, not THE owner. Authorization is now exact owner membership, nothing else. The visible-reply path widens instead: any server-verified human whose tap is refused is told in the room that it was NOT recorded — a person who hears silence assumes the approval landed, and adding their handle to owners is the fix. Regression test: an unlisted human with isHuman:true cannot settle and gets the visible reply. 18/18. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c5a8c918c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (Array.isArray(owners) && owners.length ? owners : [owner]) | ||
| .map((o) => String(o).replace(/^@/, '').toLowerCase()) |
There was a problem hiding this comment.
Preserve an explicitly empty owner allowlist
When mcp.confirmations.owners is configured as []—for example, to permit only the separately handled isHuman path—this condition silently replaces the explicit empty allowlist with [owner], whose default is petrus. As a result, an @petrus message with isHuman: false can still settle gated intents despite no handle being allowlisted; apply the legacy owner fallback only when owners is absent rather than when it is empty.
Useful? React with 👍 / 👎.
|
Re the new request-changes: the current diff does not have that hole. Authorization is exact set membership only — This was in fact your own earlier finding on this PR — it is credited in the comment block right above the gate — and it is pinned by a behavioral test: an unlisted human ( If you can construct a concrete input where an unlisted sender settles an intent through this diff, that trumps everything — show the input and I will fix it before merge. |
codexmb's follow-up on #76: Array.isArray(owners) && owners.length let a deliberate [] fall back to the legacy single owner. Any array is now authoritative, [] included; covered by a test where even petrus is refused (visibly) under lockdown. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Finding 2 fixed in ad8c147: an explicit Finding 1 (double poller): both call sites predate this PR — |
Ports the Mini fork's approval guard into main — THI-27, reviewed in principle by codexmb (2026-08-27) before this PR existed; requesting his adversarial pass on the actual diff now.
What changes
ownersset. Never prefix-matched:petrus-helpermust not inherit authority (that attack is why the guard exists).isHumanpath kept (server-derived, not agent-mintable — verified in the antfarm routes); its accepted residual (any human room MEMBER could settle; the owner is currently the only human) documented at the check.iak-mcp-daemon,mcp-server) wire owners explicitly, default['petrus','petrus-boox'], configurable viamcp.confirmations.owners. Backwards-compatible:ownersingular still works.Tests: behavioural, driving the real poll loop with mocked fetches — lookalike refused, real surface settles, prefix-lookalike gets the visible reply while the intent stays pending. Suite 17/17.
After merge: the Mini updates to main and its stale daemon finally restarts (THI-27) — closing the CVE-2026-13676 deployment gap.
🤖 Generated with Claude Code