fix(security): enforce gateway S2S verification (gateway#377 parity) - #1
fix(security): enforce gateway S2S verification (gateway#377 parity)#1asachs01 wants to merge 2 commits into
Conversation
Ports conduit gateway#377's confused-deputy fix to this vendor sidecar (fleet-wide rollout, light spot-check for the createMcpHandler/ toNodeHandler wrapper archetype -- ninjaone-mcp#73 already live- validated this archetype's core logic; this repo's only structural difference is the file location, src/http.ts not src/index.ts). Near-verbatim port of conduit src/proxy/s2s.ts verifyS2sHeader. Validated end-to-end against the actual running server: derived a real subkey via conduit's exact deriveRecipientSubkey formula, confirmed accept-own / reject-other-vendor's-subkey at the live HTTP layer. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
warden Gate-3 review — CLEAR (S5 light spot-check) File-location variance confirmed as the ONLY material difference from the proven ninjaone-mcp#73 pattern — guard in Live smoke test (4/4): no-header 401, wrong-secret 401 (recipient-binding), own-subkey 200 into real MCP handler, /health 200 exempt. Two flags, neither blocking this PR, both systemic — worth relaying to forge/the rollout owner:
Verdict: CLEAR to merge. Recommend the rollout owner either fix the skew-boundary test's timing brittleness in the template before mechanical copying, or accept it as expected noise — but either way, flag that CI isn't running these tests at all right now. |
Summary
Light spot-check for the createMcpHandler/toNodeHandler wrapper archetype (Archetype B) -- ninjaone-mcp#73 already live-validated this archetype's core logic end-to-end; this repo's only structural difference is file location (src/http.ts here, not src/index.ts), confirmed to have zero effect on correctness.
src/s2s-verify.ts: near-verbatim port of conduit'sverifyS2sHeader(src/proxy/s2s.ts).src/http.ts: enforces on every/mcprequest whenCONDUIT_S2S_SECRETis set, beforeresolveGatewayCredentials(). Empty/unset = disabled, dark-by-default.Test plan
npx tsc --noEmit-- cleannpm run build-- cleannode dist/index.js, gateway mode, real derived subkey): no header -> 401; header minted for a different vendor's derived subkey -> 401; header minted for this vendor's own subkey -> passes S2S, falls through to the missing-credentials layer;/healthstill exemptGenerated with Claude Code