Skip to content

fix(security): close unauthenticated MCP host execution and proxy bypass - #50

Merged
reprewindai-dev merged 3 commits into
mainfrom
security/capi-mcp-host-rce-20260823
Aug 23, 2026
Merged

fix(security): close unauthenticated MCP host execution and proxy bypass#50
reprewindai-dev merged 3 commits into
mainfrom
security/capi-mcp-host-rce-20260823

Conversation

@reprewindai-dev

Copy link
Copy Markdown
Owner

Incident

Production cAPI exposes /api/mcp/servers and the direct /api/proxy/{serverId}/{...path} forwarder without an effective authentication gate. The MCP registry accepts local-process descriptors, and the stdio transport inherited the complete cAPI process environment.

Fix

  • require the existing Covenant admin token for both GET and POST on /api/mcp/servers
  • reject local-process MCP in production; permit it only in non-production when CAPI_ALLOW_LOCAL_PROCESS_MCP=true
  • remove ...process.env inheritance from spawned stdio MCP processes; only a minimal non-secret runtime allowlist plus explicitly supplied descriptor env is passed
  • enforce BYOS_INTERNAL_API_KEY on every direct proxy method
  • fail closed if the internal key is not configured
  • strip cAPI internal auth headers before forwarding upstream

Truth boundary

This is source remediation. It does not by itself remove capi.veklom.com from public ingress or prove the deployed runtime is fixed. Production ingress should still be closed/restricted immediately, then this commit deployed and verified with unauthenticated negative tests.

Required deployment checks

  1. unauthenticated GET /api/mcp/servers => 401/503, never inventory
  2. unauthenticated POST /api/mcp/servers => 401/503, never process spawn
  3. authenticated production local-process registration => 403
  4. direct proxy without X-API-Key => 401/503
  5. valid internal proxy request succeeds without forwarding the internal key upstream
  6. confirm no public route exposes an alternate MCP registration/proxy path

@vercel

vercelBot commented Aug 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
c-apiErrorErrorAug 23, 2026 2:21pm
veklom-id-59uwErrorErrorAug 23, 2026 2:21pm

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: edd09347-e201-4dc4-af3c-529bb5281352


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@reprewindai-devreprewindai-dev left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security containment: keep this PR draft. The source direction is appropriate (admin-gated MCP registry, production local-process denial, no full process.env inheritance, fail-closed direct proxy auth), but exact-head cAPI CI run 32644995839 concludes failure. Before promotion, add/confirm focused negative tests for unauthenticated GET/POST registry access, production local-process denial, missing/wrong X-API-Key on every proxy method, and proof the internal/admin credentials are stripped upstream. Also audit remote MCP/OpenAPI registration URLs for SSRF/egress policy: authentication alone does not make caller-selected remote endpoints safe. Runtime remains NOT_VERIFIED until the deployed SHA, HTTP/protocol identity, listener 3003, and Traefik routing agree; public ingress exposure must be independently checked.

@reprewindai-dev
reprewindai-dev marked this pull request as ready for review August 23, 2026 14:21
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@reprewindai-dev
reprewindai-dev merged commit eb38524 into mainAug 23, 2026
2 of 5 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@reprewindai-dev