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

> Attackers can bypass intermediary inspection and policy filters in MCP messages by exploiting null Unicode character handling in JSON parsing.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Mar 2026
- **Also known as:** GO-2026-4770

## What is GHSA-q382-vc8q-7jhj?

GHSA-q382-vc8q-7jhj is a vulnerability in github.com/modelcontextprotocol/go-sdk, published on 19 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

## Which versions are affected by GHSA-q382-vc8q-7jhj?

3 open source packages ship an affected version, including github.com/modelcontextprotocol/go-sdk.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/modelcontextprotocol/go-sdk` | Go | All versions | 1.4.1 |
| `github.com/modelcontextprotocol/go-sdk` | Go | All versions | 1.4.1 |
| `github.com/modelcontextprotocol/go-sdk` | Go | All versions | 1.4.1 |

## How do I fix GHSA-q382-vc8q-7jhj?

Upgrade github.com/modelcontextprotocol/go-sdk to 1.4.1 or later.

## Is GHSA-q382-vc8q-7jhj being exploited?

There is no known exploitation of GHSA-q382-vc8q-7jhj in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q382-vc8q-7jhj and fix it if it is affected.

What it is: GHSA-q382-vc8q-7jhj is a vulnerability in github.com/modelcontextprotocol/go-sdk, published on 19 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-q382-vc8q-7jhj in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/modelcontextprotocol/go-sdk (Go): affected all versions; fixed in 1.4.1
- github.com/modelcontextprotocol/go-sdk (Go): affected all versions; fixed in 1.4.1
- github.com/modelcontextprotocol/go-sdk (Go): affected all versions; fixed in 1.4.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-q382-vc8q-7jhj/ (Markdown: https://insights.sbomify.com/GHSA-q382-vc8q-7jhj/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q382-vc8q-7jhj

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q382-vc8q-7jhj/
Summaries are generated and may contain mistakes; the official description above is the record.
