Skip to content

Commit f761018

Browse files
renovate[bot]actions-user
authored andcommitted
fix(deps): update module github.com/modelcontextprotocol/go-sdk to v1.4.1 [security] (#4347)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/modelcontextprotocol/go-sdk](https://redirect.github.com/modelcontextprotocol/go-sdk) | `v1.4.0` → `v1.4.1` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fmodelcontextprotocol%2fgo-sdk/v1.4.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fmodelcontextprotocol%2fgo-sdk/v1.4.0/v1.4.1?slim=true) | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/370) for more information. ### GitHub Vulnerability Alerts #### [GHSA-q382-vc8q-7jhj](https://redirect.github.com/modelcontextprotocol/go-sdk/security/advisories/GHSA-q382-vc8q-7jhj) The Go SDK recently transitioned to the `segmentio/encoding` library for JSON parsing in version 1.3.1. While this change addressed both case-insensitivity and ASCII folding issues, the new parser implemented aggressive key matching that treated keys with `null` Unicode characters appended at the end as equivalent to their base strings. #### Impact When combined with duplicate keys, the described behavior leads to a "last key wins" resolution that could override the intended MCP message. This had the potential for: - **Bypassing intermediary inspection:** Proxies or policy layers that matched on exact field names may have failed to detect or filter these messages. - **Cross-implementation inconsistency:** Other MCP SDKs (TypeScript, Python) use case-sensitive parsing and would reject the same messages, creating potential security-boundary confusion. #### Fix: The `segmentio/encoding` package was patched with a fix in segmentio/encoding@7d5a25d and a new version of the package was released (`v0.5.4`). The SDK switched to the patched version of the dependency in 724dd47aa. Users are advised to update to v1.4.1 to resolve this issue. #### Credits: Thank you to Francesco Lacerenza (Doyensec) for reporting this issue. --- ### Release Notes <details> <summary>modelcontextprotocol/go-sdk (github.com/modelcontextprotocol/go-sdk)</summary> ### [`v1.4.1`](https://redirect.github.com/modelcontextprotocol/go-sdk/releases/tag/v1.4.1) [Compare Source](https://redirect.github.com/modelcontextprotocol/go-sdk/compare/v1.4.0...v1.4.1) ***This release is a patch release for v1.4.0.*** It contains cherry-picks for several security improvements. Security advisories will follow. ### Fixes #### Update of the `segmentio/encoding` module version The JSON parsing library that was adopted to avoid attacks taking advantage of the Go's standard parser being case insensitive turned out to contain an issue itself. We have submitted the fix upstream and this release updates the dependency to the patched version. #### Cross-origin requests protection We have added additional protection against cross origin requests. From now on, we verify that `Content-Type` for JSON-RPC `POST` requests is set to `application/json` and use the new `http.CrossOriginProtection` functionality to verify the origin of the request. Usage of this functionality required **increasing the required Go version to 1.25**, which is in line with our Go version policy of supporting two newest Go versions. The behavior can be customized by passing a configured `http.CrossOriginProtection` object to `StreamableHTTPOptions`. Since this is a behavior change, we introduced a compatibility parameter `disablecrossoriginprotection` that will allow to temporarily disable it. It will be removed in `v1.6.0` version of the SDK. See [here](https://redirect.github.com/modelcontextprotocol/go-sdk/blob/main/docs/mcpgodebug.md) for more details about behavior changes and a history of compatibility parameters across SDK versions. #### Allowing customization of `http.Client` for client-side OAuth We have introduced an optional `http.Client` parameter to `AuthorizationCodeHandlerConfig`. This allows customization of the transport, for example implementing environment specific protection against [Server-Side Request Forgery](https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices#server-side-request-forgery-ssrf). ### Pull requests - internal: fix Unicode zero character handling by [@&#8203;maciej-kisiel](https://redirect.github.com/maciej-kisiel) in [#&#8203;841](https://redirect.github.com/modelcontextprotocol/go-sdk/pull/841) - auth: allow passing custom http.Client to AuthorizationCodeHandler by [@&#8203;maciej-kisiel](https://redirect.github.com/maciej-kisiel) in [#&#8203;840](https://redirect.github.com/modelcontextprotocol/go-sdk/pull/840) - mcp: verify 'Origin' and 'Content-Type' headers by [@&#8203;maciej-kisiel](https://redirect.github.com/maciej-kisiel) in [#&#8203;842](https://redirect.github.com/modelcontextprotocol/go-sdk/pull/842) **Full Changelog**: <modelcontextprotocol/go-sdk@v1.4.0...v1.4.1> </details> --- ### Configuration 📅 **Schedule**: Branch creation - "" in timezone Europe/London, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/overmindtech/workspace). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwiZ29sYW5nIl19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> GitOrigin-RevId: 25faf3a4f8dc8c406e86a6df26dfc1813eb42795
1 parent 2d9f65b commit f761018

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ require (
135135
github.com/miekg/dns v1.1.72
136136
github.com/mitchellh/go-homedir v1.1.0
137137
github.com/mitchellh/go-ps v1.0.0
138-
github.com/modelcontextprotocol/go-sdk v1.4.0
138+
github.com/modelcontextprotocol/go-sdk v1.4.1
139139
github.com/muesli/reflow v0.3.0
140140
github.com/nats-io/jwt/v2 v2.8.0
141141
github.com/nats-io/nats-server/v2 v2.12.5
@@ -445,7 +445,7 @@ require (
445445
github.com/samber/lo v1.52.0 // indirect
446446
github.com/samber/slog-common v0.20.0 // indirect
447447
github.com/segmentio/asm v1.2.1 // indirect
448-
github.com/segmentio/encoding v0.5.3 // indirect
448+
github.com/segmentio/encoding v0.5.4 // indirect
449449
github.com/shirou/gopsutil/v3 v3.23.7 // indirect
450450
github.com/shoenig/go-m1cpu v0.1.6 // indirect
451451
github.com/sorairolake/lzip-go v0.3.5 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
852852
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
853853
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
854854
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
855-
github.com/modelcontextprotocol/go-sdk v1.4.0 h1:u0kr8lbJc1oBcawK7Df+/ajNMpIDFE41OEPxdeTLOn8=
856-
github.com/modelcontextprotocol/go-sdk v1.4.0/go.mod h1:Nxc2n+n/GdCebUaqCOhTetptS17SXXNu9IfNTaLDi1E=
855+
github.com/modelcontextprotocol/go-sdk v1.4.1 h1:M4x9GyIPj+HoIlHNGpK2hq5o3BFhC+78PkEaldQRphc=
856+
github.com/modelcontextprotocol/go-sdk v1.4.1/go.mod h1:Bo/mS87hPQqHSRkMv4dQq1XCu6zv4INdXnFZabkNU6s=
857857
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
858858
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
859859
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -1038,8 +1038,8 @@ github.com/sashabaranov/go-openai v1.41.2 h1:vfPRBZNMpnqu8ELsclWcAvF19lDNgh1t6TV
10381038
github.com/sashabaranov/go-openai v1.41.2/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
10391039
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
10401040
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
1041-
github.com/segmentio/encoding v0.5.3 h1:OjMgICtcSFuNvQCdwqMCv9Tg7lEOXGwm1J5RPQccx6w=
1042-
github.com/segmentio/encoding v0.5.3/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
1041+
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
1042+
github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
10431043
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
10441044
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
10451045
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=

0 commit comments

Comments
 (0)