Issue #68: Security review — middleware and agent (authn/authz, HMAC, secrets, SSRF) #75

Merged
gotoi-agent merged 1 commit from issue/68-security-review into agent-develop 2026-10-08 06:37:57 +02:00
Collaborator

Security audit of middleware/ and agent/ per issue #68. Six scope areas swept; findings F1-F7 documented with severity and file:line evidence in the issue thread.

Fixed here: F1 (HIGH) — dead instance-operator gate on GET /plans/ai/config allowed any authenticated org member to read stored AI provider config incl. provider token headers; gate hoisted above the blanket GET rule, red-first regression test added (UC-MW-167 block).

Documented for triage (unfixed, specified in plan): F2 result-route agent-ownership, F3 archive cross-org leak, F4 path token in request logs, F5 workflow sh -c substitution, F6 FIND_MUTATE gaps, F7 latent turn.model ref; plus a negative-results list.

review: PARTIAL (independent reviewer verified F1 fix + report honesty, refined F2-F5 fix hints, no additional commits). Gates: UC check/ai-headers/type-mirror green; middleware suite 584 pass + 1 pre-existing flake class (UC-MW-09, re-passed isolated twice). Refs #68.

Security audit of middleware/ and agent/ per issue #68. Six scope areas swept; findings F1-F7 documented with severity and file:line evidence in the issue thread. Fixed here: F1 (HIGH) — dead instance-operator gate on GET /plans/ai/config allowed any authenticated org member to read stored AI provider config incl. provider token headers; gate hoisted above the blanket GET rule, red-first regression test added (UC-MW-167 block). Documented for triage (unfixed, specified in plan): F2 result-route agent-ownership, F3 archive cross-org leak, F4 path token in request logs, F5 workflow sh -c substitution, F6 FIND_MUTATE gaps, F7 latent turn.model ref; plus a negative-results list. review: PARTIAL (independent reviewer verified F1 fix + report honesty, refined F2-F5 fix hints, no additional commits). Gates: UC check/ai-headers/type-mirror green; middleware suite 584 pass + 1 pre-existing flake class (UC-MW-09, re-passed isolated twice). Refs #68.
The instance-operator rule for GET /plans/ai/config sat below the blanket
`if (m === 'GET' || m === 'HEAD') return 'viewer';`, so it was unreachable:
any authenticated org member could read the stored AI provider headers,
which may carry a private provider token.

Hoist the rule above the blanket GET rule and pin it with a red-first test.

Refs #68, UC-MW-167
gotoi-agent merged commit 98da205212 into agent-develop 2026-10-08 06:36:56 +02:00
Sign in to join this conversation.
No description provided.