The vulnerability, identified as CVE-2026-27896 and GHSA-wvj2-96wp-fq3f, stems from the use of Go's standard encoding/json.Unmarshal function for parsing JSON-RPC and MCP protocol messages. This function performs case-insensitive matching of JSON keys to struct field tags, which violates the JSON-RPC 2.0 specification requiring exact field names. This flaw could allow a malicious actor to craft JSON payloads with altered casing (e.g., "Method" instead of "method") that would be accepted by the Go SDK but potentially bypass security proxies or be rejected by other, stricter MCP SDK implementations (like TypeScript or Python).
The fix, implemented in commit 7b8d81c, was to replace all instances of encoding/json.Unmarshal with a new internal function that utilizes the github.com/segmentio/encoding/json library, configured specifically for case-sensitive decoding.
My analysis of the patch identified numerous functions across the mcp and oauthex packages that were responsible for unmarshaling JSON data from external sources. These functions are considered the vulnerable functions because they were the entry points for potentially malicious, case-altered JSON. Any of these functions would appear in a runtime profile or stack trace during the processing of such a message. The identified functions cover a wide range of protocol operations, from decoding basic messages and content parts to handling tool results, server requests, and OAuth client registration.