Details
Boundary delta
| | Starting capability | After exploit |
|---|---|---|
| Identity | Holder of a fresh io.github.<attacker> GitHub account | Same |
| Publish scope | io.github.<attacker>/* only | io.github.<attacker>/* only (unchanged) |
| OCI claim scope | OCI images the attacker controls and has labelled with io.modelcontextprotocol.server.name = io.github.<attacker>/<name> | Any public OCI image at any allowlisted registry, regardless of label |
The attacker's namespace stays bounded. What changes is that the registry's claim "this OCI image is
the package payload of this MCP server" is no longer backed by any cross-system proof. The label
check at oci.go:122-141 is the only ownership proof for OCI packages; bypassing it lets a
publisher under io.github.attacker/* bind a server record to an unrelated image such asdocker.io/microsoft/<some-tool>:latest without ever touching that image. Combined with how MCP
clients render server-list entries — image identifier shown next to the namespace — the result is
typo-squat / impersonation in registry search and discovery surfaces, with the actual image content
delivered untouched from its real owner.
The same fail-open is reached without any attacker action whenever Docker Hub rate-limits the
registry's egress IP for organic reasons. In that mode, the OCI ownership check is effectively
non-functional for the duration of the limit window, even for legitimate publishers.
Cross-validator comparison (negative control)
The other registry-type validators do not fail-open on rate-limit responses:
internal/validators/registries/npm.go:72-74—if resp.StatusCode != http.StatusOK { return error }.internal/validators/registries/pypi.go:76-78— same shape; 429 surfaces as"PyPI package '%s' not found (status: %d)".internal/validators/registries/nuget.go:253— non-OK response paths return"NuGet README request returned status %d", the publish fails closed.internal/validators/registries/mcpb.go:84-91— a HEAD that does not return 200 or a 3xx withLocationis treated as inaccessible.
OCI is the only validator that converts an upstream rate-limit into a successful ownership
attestation.
Suggested fix
Two options, either alone, or both for defence-in-depth:
- Remove the fail-open. Replace
case http.StatusTooManyRequests:
log.Printf("Skipping OCI validation for %s due to rate limiting", pkg.Identifier)
return nil
with an error of the same shape the other validators use (`return fmt.Errorf("OCI registry is
currently rate-limiting validations for '%s'; please retry shortly", pkg.Identifier)`). The
handler call sites in validateRegistryOwnership already propagate the error to a 400 response.
- Replace
authn.Anonymousatinternal/validators/registries/oci.go:97with an authenticated token whose quota is isolated from organic anonymous traffic to the registry's egress IP. Docker Hub authenticated pulls are 200/6h per token; ghcr.io / quay.io /*.pkg.dev/*.azurecr.ioeach have their own auth flows. This removes the easy attacker-side trigger and reduces organic fail-open windows.
If a fail-open path is retained for UX reasons, queue the publish for re-validation when the
upstream registry recovers, instead of marking it accepted on first attempt.
Proof of concept
The refreshed PoC drives the publish path, not only the validator branch:
service.CreateServer
-> validators.ValidatePublishRequest
-> registries.ValidateOCI
-> database.CreateServer
It runs inside the checked-out module, uses the real service and validator code, and substitutes only
the database with a minimal in-memory implementation so the proof can run without a local Postgres
stack. To keep the proof localhost-only, the runner temporarily adds the in-process mock OCI host to
the unexported OCI allowlist. It does not contact Docker Hub, the production registry, or any
external service.
To run:
bash outputs/poc-evidence/2026-05-12-mcp-registry-publish-path/run.sh
Captured transcript:
=== modelcontextprotocol/registry publish-path OCI 429 fail-open PoC ===
Path exercised: service.CreateServer -> validators.ValidatePublishRequest -> registries.ValidateOCI -> DB CreateServer
--- negative control: upstream 404 ---
[setup] temporarily allowlisted mock OCI host 127.0.0.1:39067 for localhost-only proof
[setup] publish identifier=127.0.0.1:39067/reputable-org/reputable-image:latest
[mock-oci] GET /v2/ -> 404
[publish] rejected: registry validation failed for package 0 (127.0.0.1:39067/reputable-org/reputable-image:latest): OCI image '127.0.0.1:39067/reputable-org/reputable-image:latest' does not exist in the registry
--- BUG: upstream 429 ---
[setup] temporarily allowlisted mock OCI host 127.0.0.1:40487 for localhost-only proof
[setup] publish identifier=127.0.0.1:40487/reputable-org/reputable-image:latest
[mock-oci] GET /v2/ -> 429
[memdb] AcquirePublishLock(io.github.attacker/typosquat-tool)
[memdb] CreateServer stored name=io.github.attacker/typosquat-tool version=1.0.1 package=127.0.0.1:40487/reputable-org/reputable-image:latest
[publish] accepted/stored packages=[{"registryType":"oci","identifier":"127.0.0.1:40487/reputable-org/reputable-image:latest","transport":{"type":"stdio"}}]
PUBLISH_PATH_RESULT: ACCEPTED_UNVERIFIED_OCI_PACKAGE_AFTER_429
Exit code 0. SHA-256 values:
acf7121111c19acaca1c99a3c08079213794ffc4feb63e545ec814bd6cd85984 transcript.txt
340e7a81740e9f14cadc144d4e640a1d497ce3e6696a3d9ea99d63e05c5edd71 publish_path_runner.go
c970f08d6b79852308ad931da85dd64a65fe373d3c988018de09a7e4c7c345a4 run.sh
The end-to-end attacker flow against production was not executed. No publish was sent againstregistry.modelcontextprotocol.io. No attacker namespace was registered on the live service. The
local proof shows the critical property: when the actual publish validator sees an OCI 429, the
service proceeds to create a server record containing the unverified OCI package identifier.
Severity rationale
Maintainer triage (2026-05-13): after review the maintainer settled on Low (3.5, CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N). Impact stays within the attacker's own namespace and image bytes delivered to clients are unchanged. See the comment thread for reasoning. Reporter's original write-up preserved below.
Medium. Auth-bypass class — the attacker bypasses the only ownership proof for OCI packages, and the
fail-open trigger is attacker-controllable from a single IP at modest cost. The blast radius is
bounded to publication misrepresentation under the attacker's own namespace; the actual image
content stays under its rightful owner. Combined with normal MCP-client search and discovery
surfaces, this is sufficient for impersonation / typo-squat where the rendered image identifier
implies authorship the registry could not actually attest.
The fail-open also activates under normal traffic when Docker Hub rate-limits the egress IP, so the
OCI ownership check is in practice intermittent rather than absent — both modes are bug states.