Added endpoint validation for Service Bus namespace (#2347)#2349
Merged
xiangyan99 merged 3 commits intorelease/azure/2.xfrom Apr 6, 2026
Merged
Added endpoint validation for Service Bus namespace (#2347)#2349xiangyan99 merged 3 commits intorelease/azure/2.xfrom
xiangyan99 merged 3 commits intorelease/azure/2.xfrom
Conversation
* Added endpoint validation for Service Bus namespace * updates
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens Azure Service Bus tooling by validating the --namespace/namespaceName input against allowed Azure Service Bus domain suffixes (per cloud), preventing attacker-controlled endpoints and non-host values from being used.
Changes:
- Added
servicebusallowed domain suffixes to the sharedEndpointValidatorand expanded its unit test coverage. - Added namespace host validation inside
ServiceBusServicebefore creating Service Bus clients. - Added Service Bus-specific unit tests and a server changelog entry documenting the update.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.UnitTests/Services/ServiceBusServiceNamespaceValidationTests.cs | Adds unit tests ensuring ServiceBusService rejects attacker-controlled/non-host namespace inputs. |
| tools/Azure.Mcp.Tools.ServiceBus/src/Services/ServiceBusService.cs | Adds ValidateNamespace() and calls it from all Service Bus operations. |
| servers/Azure.Mcp.Server/changelog-entries/1775486458224.yaml | Adds changelog entry describing the new endpoint/namespace validation. |
| core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.UnitTests/Helpers/EndpointValidatorTests.cs | Adds servicebus coverage across public + sovereign cloud environments. |
| core/Microsoft.Mcp.Core/src/Helpers/EndpointValidator.cs | Adds Service Bus suffix mapping to GetAllowedDomainSuffixes(). |
joshfree
approved these changes
Apr 6, 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.
Added endpoint validation for Service Bus namespace
updates
What does this PR do?
[Provide a clear, concise description of the changes][Add additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline