fix(auth): reject github.io domains in DNS/HTTP token exchange (org namespace takeover) - #1506
Open
SashaMIT wants to merge 1 commit into
Open
Conversation
The GitHub method grants io.github.<org>/* only to org Owners (active admin membership). The DNS/HTTP exchange granted reversed(domain)/* for any proven domain with no github.io special-casing and an empty BlockedNamespaces list. Since <org>.github.io is served from the <org>/<org>.github.io Pages repository, anyone with push access to that single repo — ordinary org members, far below Owner — could serve a key at /.well-known/mcp-registry-auth and mint publish rights over the whole org namespace, defeating the documented Owner-only gate. Reject github.io and its subdomains at the shared ValidateDomainAndTimestamp seam; io.github.* publishers use the GitHub method. Signed-off-by: SashaMIT <sash@ela.city> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
io.github.<org>/*publish rights only to org Owners (activeadminmembership —github_at.go).reversed(domain)/*for any proven domain, with nogithub.iospecial-casing and an emptyBlockedNamespaceslist.<org>.github.iois served by GitHub Pages from the<org>/<org>.github.iorepository. 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 entireio.github.<org>/*namespace.github.io(and subdomains) at the sharedValidateDomainAndTimestampseam 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
TestValidateDomainAndTimestampRejectsGitHubPages: rejectsmy-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.internal/api/handlers/v0/authpackage passes.Made with Cursor