Skip to content

Enhance URL glob matching to enforce subdomain wildcard matching on dot boundaries#303263

Merged
TylerLeonhardt merged 1 commit intomainfrom
tyler/ordinary-mouse
Mar 19, 2026
Merged

Enhance URL glob matching to enforce subdomain wildcard matching on dot boundaries#303263
TylerLeonhardt merged 1 commit intomainfrom
tyler/ordinary-mouse

Conversation

@TylerLeonhardt
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 17:11
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) March 19, 2026 17:11
@TylerLeonhardt TylerLeonhardt self-assigned this Mar 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Tightens *. subdomain wildcard handling in the URL glob matcher so that *.example.com only matches on a dot boundary (or the bare apex domain), preventing unintended matches like notexample.com.

Changes:

  • Update *. matching logic to only “exit” the subdomain wildcard at the start of the authority or immediately after a . in the URL.
  • Add regression tests ensuring *.domain.com does not match lookalike domains lacking a dot boundary (e.g. evil-microsoft.com, notexample.com).
  • Add coverage for the same dot-boundary rule when the glob omits the scheme.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/platform/url/common/urlGlob.ts Restricts *. wildcard transitions to dot boundaries / start-of-authority to avoid overbroad domain matches.
src/vs/platform/url/test/common/urlGlob.test.ts Adds targeted test cases validating the new dot-boundary behavior (with and without scheme).

You can also share your feedback on Copilot code review. Take the survey.

@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 19, 2026
@TylerLeonhardt TylerLeonhardt merged commit b369f04 into main Mar 19, 2026
23 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/ordinary-mouse branch March 19, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants