# GHSA-q382-vc8q-7jhj: Improper handling of null Unicode character when parsing JSON in github.com/modelcontextprotocol/go-sdk

- Severity: High (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:L/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-03-19T12:44:07.000Z
- Modified: 2026-09-10T03:50:40.418Z
- Also known as: GO-2026-4770
- Related: CGA-wp3h-3v2w-228r
- Weaknesses: CWE-436, CWE-1395

## Description

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 https://github.com/segmentio/encoding/commit/7d5a25dbc5da13aed3cb047a127e4d0e96f536fb 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.

(As written by GitHub Advisory Database.)

## Affected

- github.com/modelcontextprotocol/go-sdk (Go): before 1.4.1

## References

- <https://github.com/modelcontextprotocol/go-sdk/security/advisories/GHSA-q382-vc8q-7jhj> (advisory, web)
- <https://github.com/modelcontextprotocol/go-sdk/commit/724dd47aa3431b9d4cf9ac2eebbf7b38a629afca> (fix, web)
- <https://github.com/segmentio/encoding/commit/7d5a25dbc5da13aed3cb047a127e4d0e96f536fb> (web)
- <https://github.com/modelcontextprotocol/go-sdk> (package)

## Sources

- GitHub Advisory Database: [GHSA-q382-vc8q-7jhj](https://github.com/advisories/GHSA-q382-vc8q-7jhj), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2026-4770](https://pkg.go.dev/vuln/GO-2026-4770), CC-BY-4.0, modified 2026-03-25

---

Page: https://cve.day/GHSA-q382-vc8q-7jhj · Whole record: https://cve.day/GHSA-q382-vc8q-7jhj.json · Rebuilt by cve.day 2026-11-25T22:56:24.509Z
