fix(auth): reject gitlab.io domains in DNS/HTTP token exchange - #1574
Open
latent-9 wants to merge 1 commit into
Open
fix(auth): reject gitlab.io domains in DNS/HTTP token exchange#1574latent-9 wants to merge 1 commit into
latent-9 wants to merge 1 commit into
Conversation
GitLab Pages serves <group>.gitlab.io from the <group>/<group>.gitlab.io repository, which ordinary Developers can be granted push access to. The DNS/HTTP proof therefore demonstrates control of a single Pages repository, not group ownership, yet it minted publish permissions for the whole io.gitlab.<group>/* namespace — the same weaker-bar takeover modelcontextprotocol#1506 closed for GitHub Pages. Reject gitlab.io (and subdomains) alongside github.io in ValidateDomainAndTimestamp, with lookalike coverage in the test table.
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.
What
Extends the shared-hosting rejection added in #1506 from
github.iotogitlab.io(and subdomains) inValidateDomainAndTimestamp, which guards both DNS and HTTP token exchange.Why
GitLab Pages serves
<group>.gitlab.iofrom the<group>/<group>.gitlab.iorepository, and that repository can be written to by group members holding the Developer role — a far weaker bar than group ownership. The DNS/HTTP proof therefore demonstrates control of one Pages repository, yet it minted publish permissions for the entireio.gitlab.<group>/*namespace.This is the same weaker-bar takeover #1506 closed for GitHub Pages; GitLab Pages is the identical mechanic (per-group Pages repository) and was notably absent from that fix.
Change
isGitLabPagesDomaincheck alongsideisGitHubPagesDomain, with a distinct error message pointing GitLab users at apex-domain proof.my-group.gitlab.io(including mixed case and subdomains), plus lookalikes (gitlab.io.evil-example.com,my-group.gitlab.io.example.com) that must remain allowed.Scope note: first-come-claimable hosts without an org-repository model (netlify.app, vercel.app, pages.dev) raise a different trust question and are deliberately left out of this PR.