registry/internal/api/handlers/v0
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sash 5c19656cb9
fix(auth): reject github.io domains in DNS/HTTP token exchange (org namespace takeover) (#1506)
## Summary

- The GitHub token method grants `io.github.<org>/*` publish rights
**only to org Owners** (active `admin` membership — `github_at.go`).
- The DNS/HTTP token methods grant `reversed(domain)/*` for any proven
domain, with no `github.io` special-casing and an empty
`BlockedNamespaces` list.
- `<org>.github.io` is served by GitHub Pages from the
`<org>/<org>.github.io` repository. **Push access to that one
repository** — routinely held by ordinary org members, a much weaker bar
than Owner — is enough to serve a key at
`/.well-known/mcp-registry-auth`, exchange it for a JWT, and publish
under the org's entire `io.github.<org>/*` namespace.
- Reject `github.io` (and subdomains) at the shared
`ValidateDomainAndTimestamp` seam used by both DNS and HTTP exchange;
`io.github.*` publishers already have the GitHub method.

## Impact if unsolved

Any org member with write access to the org's GitHub Pages repo (or an
attacker compromising such a member) can mint MCP packages under the
org's trusted namespace — supply-chain poisoning of every downstream
user who installs `<org>`'s servers from the registry, bypassing the
deliberate Owner-only gate.

## Test plan

- New `TestValidateDomainAndTimestampRejectsGitHubPages`: rejects
`my-org.github.io` (incl. mixed case and subdomains), still allows
lookalikes (`github.io.evil-example.com`,
`my-org.github.io.example.com`) and ordinary domains.
- Full `internal/api/handlers/v0/auth` package passes.

Made with [Cursor](https://cursor.com)

Signed-off-by: SashaMIT <sash@ela.city>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 01:38:34 +03:00
..
auth fix(auth): reject github.io domains in DNS/HTTP token exchange (org namespace takeover) (#1506) 2026-08-07 01:38:34 +03:00
edit.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
edit_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
health.go Replace / with - for operation IDs (#660) 2025-10-14 15:26:43 +03:00
health_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
list_errors.go fix: don't leak internal error detail in GET /v0/servers 500 response (#1338) 2026-06-05 03:08:33 -04:00
list_errors_test.go fix: don't leak internal error detail in GET /v0/servers 500 response (#1338) 2026-06-05 03:08:33 -04:00
ping.go Replace / with - for operation IDs (#660) 2025-10-14 15:26:43 +03:00
ping_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
publish.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
publish_integration_test.go Make Repository field properly optional in server.json (#717) 2025-10-29 13:23:47 +00:00
publish_registry_validation_test.go Introduce v0.1 version of the API (#658) 2025-10-14 11:04:48 +03:00
publish_test.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
response.go auth: New auth flow (#273) 2025-08-15 13:03:35 +01:00
servers.go fix: client-cancelled GET /v0/servers returns 499 without error log (#1335) 2026-06-05 02:59:47 -04:00
servers_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
status.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
status_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
telemetry_test.go Make Repository field properly optional in server.json (#717) 2025-10-29 13:23:47 +00:00
ui.go Add simple web UI for browsing the registry (#757) 2025-11-10 12:37:36 +00:00
ui_index.html fix(ui): encode publisher-controlled URLs for href attribute context (#1248) 2026-05-04 09:25:41 -04:00
validate.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
validate_test.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00
version.go Introduce a /version API (#667) 2025-10-15 17:24:46 +03:00
version_test.go Introduce a /version API (#667) 2025-10-15 17:24:46 +03:00