fix(NODE-7478): OIDC host allowlist fix#4905
Merged
PavelSafronov merged 1 commit intomainfrom Mar 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens OIDC ALLOWED_HOSTS wildcard matching to prevent accidental acceptance of partial suffix/path matches, improving the correctness of the OIDC host allowlist validation used during client connection.
Changes:
- Updated
hostMatchesWildcardsto require boundary-aware matches for*.(subdomain) and*/(subpath) wildcards. - Added unit tests to cover the newly-disallowed partial matches, including coverage against
DEFAULT_ALLOWED_HOSTS.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/utils.ts |
Implements stricter wildcard matching rules for domain and unix-socket patterns. |
test/unit/utils.test.ts |
Adds regression tests ensuring partial suffix/path matches are rejected, including default OIDC allowlist patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tadjik1
approved these changes
Mar 27, 2026
Member
tadjik1
left a comment
There was a problem hiding this comment.
thanks @PavelSafronov! I will merge this PR after npm fix
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.
Description
Summary of Changes
Notes for Reviewers
What is the motivation for this change?
Release Highlight
Tighten OIDC ALLOWED_HOSTS wildcard matching
The OIDC ALLOWED_HOSTS wildcard handling has been fixed to require full subdomain/path matches for *. and */ entries, preventing partial suffix matches from being incorrectly accepted.
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript