Reject invalid store FQDN delimiters#7919
Open
mbarak wants to merge 1 commit into
Open
Conversation
Parse supported store inputs through URL.hostname and reject unsupported URL delimiters before normalizing Shopify store FQDNs. Co-authored-by: Pi AI <noreply@pi.dev> Assisted-By: devx/1c1546df-0edf-4c5c-930a-da142ea5a7ef
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens normalizeStoreFqdn input handling by parsing store values through the WHATWG URL API, extracting the hostname as the canonical candidate, and rejecting unsupported URL components that could otherwise be reinterpreted later during URL construction/parsing.
Changes:
- Replace string-based normalization with
URLparsing and hostname extraction, with explicit rejection of unsupported URL parts (credentials, port, query, fragment, and disallowed paths). - Add hostname label validation to ensure the normalized store value is a valid DNS-style hostname before appending Shopify domains.
- Add regression tests for delimiter-based host confusion inputs and path rejection, plus a patch changeset for
@shopify/cli-kit.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/cli-kit/src/public/node/context/fqdn.ts | Switches store normalization to URL-based parsing + strict component/path validation and hostname label checks. |
| packages/cli-kit/src/public/node/context/fqdn.test.ts | Adds regression coverage for URL-delimiter reinterpretation cases and unsupported paths. |
| .changeset/reject-store-domain-delimiters.md | Adds a patch changeset documenting the user-facing hardening behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
stephanie-shopify
approved these changes
Jun 24, 2026
aswamy
approved these changes
Jun 24, 2026
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.
WHY are these changes introduced?
Store inputs are accepted as handles, domains, or supported admin URLs before the CLI builds requests from the normalized FQDN. Normalizing them with string replacements can preserve URL delimiter characters that are interpreted differently by URL parsing later.
This hardens store normalization by resolving supported inputs to a hostname first and rejecting unsupported URL components before the normalized FQDN can be used.
WHAT is this pull request doing?
URL, addinghttps://for bare handles/domains.url.hostnameas the store-domain candidate./,/admin, or/admin/.@shopify/cli-kit.How to test your changes?
Post-release steps
None.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset addCo-authored-by: Pi AI noreply@pi.dev