wso2 / wso2/api-platform

Prevent cross-host use of stored MCP upstream credentials during refetch

Open
#3,047 0 comments 0 reactions 1 assignee View on GitHub

@Thushani-Jayasekera is already working on this.

Since Jul 30, 2026.

Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Summary

Prevent stored MCP upstream credentials from being forwarded to a caller-supplied endpoint on a different host during server-info refetch.

Required change

In platform-api/internal/service/mcp.go, update MCPProxyService.FetchServerInfo so that when both proxyId and url are supplied, the caller URL's host is compared with the stored proxy upstream URL's host before the stored credential is resolved or used.

Path- and query-only changes on the same host must remain supported. Reject a request when the hosts differ. Preserve the existing rule that auth cannot be supplied with proxyId.

Rationale

The proxyId + url flow uses the proxy's stored credential while allowing an unsaved endpoint URL. Without a host boundary, a caller can direct that credential to another host.

Affected area

  • platform-api/internal/service/mcp.go
  • MCPProxyService.FetchServerInfo
  • Associated MCP server-info fetch tests

Acceptance criteria

  • Requests containing proxyId + url are rejected when the supplied and stored upstream hosts differ.
  • Same-host URL edits, including path and query changes, continue to use stored credentials.
  • Stored credentials are not decrypted or sent after a cross-host request is rejected.
  • Existing proxyId + auth rejection remains intact.
  • Tests cover same-host acceptance and cross-host rejection.

Backlinks

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.