registry/internal
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
..
api fix(auth): reject github.io domains in DNS/HTTP token exchange (org namespace takeover) (#1506) 2026-08-07 01:38:34 +03:00
auth security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
config auth: bind GitHub OIDC token exchange to a per-deployment audience (#1229) 2026-04-29 20:27:26 -04:00
database refactor: extract readBody helper to remove duplicate io.ReadAll calls (#1241) 2026-05-04 06:57:02 -04:00
importer Enhanced server.json validation (phase 1) (#636) 2026-01-16 00:49:39 +02:00
service fix(list): use row-constructor cursor + restore per-phase publish timings + enable pg_stat_statements (#1215) 2026-04-27 15:35:59 -04:00
telemetry build(deps): bump go.opentelemetry.io/contrib/instrumentation/runtime from 0.64.0 to 0.65.0 (#940) 2026-02-09 11:11:06 +02:00
validators fix(validators): distinguish a missing package from a missing version on PyPI/NPM (#1411) 2026-07-12 15:24:34 -04:00