stacklok / stacklok/toolhive

Wire Origin validation into the vMCP middleware chain

Open
#5,400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement go security vmcp
Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Follow-up from #4908 (Origin header validation for DNS-rebind protection)

#4908 wires the origin validation middleware into the thv run / thv proxy / proxyrunner paths. vMCP composes its own middleware chain (via factory.NewIncomingAuthMiddleware and pkg/vmcp/server/server.go's Handler) and does not reference the origin package, so vMCP-fronted servers do not currently enforce Origin-header validation.

Scope
  • Integrate origin validation (or the shared origin.ResolveAllowedOrigins derivation) into the vMCP incoming middleware chain.
  • Decide how the allowlist is configured for vMCP (CLI flag / config file / CRD), consistent with the workload-CRD follow-up.
Context
  • Middleware + CLI/proxyrunner wiring landed in #4908; the original "vMCP wired" claim was corrected there.
  • Relates to the MCP 2025-11-25 §"Security Warning" spec-compliance work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading factory.NewIncomingAuthMiddleware and the Handler in pkg/vmcp/server/server.go, then compare the origin middleware and ResolveAllowedOrigins wiring from #4908. Determine how vMCP should receive its allowlist through the CLI, config file, or CRD, consistent with the workload-CRD follow-up. Done means vMCP-fronted servers enforce Origin-header validation with a documented configuration path.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.