Skip to content

fix(security): enforce gateway S2S verification (gateway#377 parity) - #49

Open
asachs01 wants to merge 1 commit into
mainfrom
security/s2s-gateway-verification
Open

fix(security): enforce gateway S2S verification (gateway#377 parity)#49
asachs01 wants to merge 1 commit into
mainfrom
security/s2s-gateway-verification

Conversation

@asachs01

Copy link
Copy Markdown
Member

Summary

Mechanical-wave port of the conduit gateway S2S verification middleware (gateway#377 confused-deputy fix) into this vendor sidecar. Pattern already live-validated end-to-end on blumira-mcp#37 and threatlocker-mcp#41; this is a mechanical replication, not a fresh design.

  • Added src/s2s-verify.ts (byte-for-byte port of conduit's verifyS2sHeader)
  • Inserted the S2S check in src/http.ts, right after the inverted 404 guard, before credential extraction (this repo's http.ts has no method check; credential extraction begins immediately after the guard)
  • Added the S2S verify test suite (src/__tests__/s2s-verify.test.ts) covering accept/reject/skew/tamper/empty-secret + recipient-binding cases

Test results

  • npx tsc --noEmit: clean, no errors
  • npm run build (tsup): clean, build success
  • npm test (vitest run): 17/17 passing (8 pre-existing + 9 new)
  • Tests ARE CI-gated on this PR via .github/workflows/test.yml — it triggers on pull_request to main (and next/next-major/beta/alpha) and runs npm run lint, npm run build, and npm test as required job steps.

Review

Do not merge without Walter + boss review — auth surface, heightened-review-and-narrate tier.

Ports conduit gateway#377's confused-deputy fix to this vendor sidecar
(fleet-wide rollout, mechanical wave — pattern already live-validated
on blumira-mcp#37/threatlocker-mcp#41). Near-verbatim port of conduit
src/proxy/s2s.ts verifyS2sHeader.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant