Prevent cross-host use of stored MCP upstream credentials during refetch
@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.goMCPProxyService.FetchServerInfo- Associated MCP server-info fetch tests
Acceptance criteria
- Requests containing
proxyId + urlare 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 + authrejection remains intact. - Tests cover same-host acceptance and cross-host rejection.
Backlinks
- Deferred from PR #3046: https://github.com/wso2/api-platform/pull/3046
- Review comment: https://github.com/wso2/api-platform/pull/3046#discussion_r3684854319
- Requested by @Thushani-Jayasekera
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.