Skip to content

fix(deps): vendor patched mcp-go for GO-2026-6911 - #1368

Open
zzet wants to merge 1 commit into
pr1351from
fix/mcp-go-ssrf-go-2026-6911
Open

zzet wants to merge 1 commit into
pr1351from
fix/mcp-go-ssrf-go-2026-6911

Conversation

@zzet

@zzet zzet commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Problem

The reported dependency vulnerability is GO-2026-6911 - SSRF and credential leak via an unvalidated Location header in github.com/mark3labs/mcp-go/client/transport. Gortex depends on the mcp-go module (used as an MCP server), and the scanner flags the module at score 9 even though the vulnerable client-transport package is not imported by gortex's code path.

Fix

Upstream has no released fix (v1.5.0, the latest, is still affected; pkg.go.dev reports "all versions, no known fixed"). The fix lives only in unmerged upstream PR #1192, which adds same-origin-only CheckRedirect policies to the default HTTP clients in the client transport.

Ship an in-tree patched copy under internal/thirdparty/mcp-go via a replace directive, matching the existing go-pointer and renameio drop-in pattern, and bump the require to v1.5.0. The patch applies PR #1192's redirect.go plus the three default-client wiring edits (oauth.go, sse.go, streamable_http.go).

Verification

  • govulncheck reports no vulnerabilities (was: GO-2026-6911 at v1.4.0 -> v1.5.0).
  • go build ./... succeeds.
  • go mod verify: all modules verified; go mod tidy is idempotent.
  • gofmt clean; golangci-lint adds no new issues (3 pre-existing errcheck findings in internal/mcp/*_test.go are unchanged from base).
  • Vendored client/transport unit tests pass.

Notes

Comment thread internal/thirdparty/mcp-go/go.mod Fixed
Comment thread internal/thirdparty/mcp-go/go.mod Fixed
mcp-go v1.5.0 has no fixed release for GO-2026-6911 (SSRF/credential leak
via unvalidated Location header in client/transport); the fix only lives in
unmerged upstream PR #1192. gortex consumes mcp-go as an MCP server (mcp,
server, tracing) and never imports the vulnerable client/transport, but the
module is flagged at the module level, so ship the patched drop-in under
internal/thirdparty/mcp-go alongside go-pointer and renameio.

Patch: add client/transport/redirect.go (same-origin CheckRedirect policies)
and wire it into oauth.go, sse.go and streamable_http.go per PR #1192.

Also bump the vendored module's golang.org/x/text to v0.43.0 (from v0.14.0)
and propagate the indirect x/tools v0.51.0, matching the version gortex
already resolves via MVS and clearing the Trivy code-scanning findings
CVE-2026-56851 / CVE-2026-56852, which otherwise fired on the vendored
go.mod even though the real binary is already above the fixed versions.

replace github.com/mark3labs/mcp-go => ./internal/thirdparty/mcp-go
@zzet
zzet force-pushed the fix/mcp-go-ssrf-go-2026-6911 branch from 2a624f6 to 0c6e7f1 Compare November 7, 2026 17:42
Sign up for free to 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.

2 participants