Harden Azure Key Vault trusted endpoint matching
Maintainers usually reply within 2 days
@apoorvdeshmukh is already working on this.
Since Oct 13, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by locating SqlColumnEncryptionAzureKeyVaultProvider and reading its trusted-endpoint validation and constructor behavior, then inspect the related tests. Add coverage for the listed DNS, scheme, port, normalization, and input-mutation cases; done means endpoint validation follows the requested structured rules while preserving the described compatibility path.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
SqlColumnEncryptionAzureKeyVaultProvider validates an Azure Key Vault key URI by checking whether Uri.Host ends with one of its trusted endpoint strings. Raw suffix matching does not require a DNS-label boundary, so a hostname can match a trusted suffix without being that domain or one of its subdomains.
The trusted-endpoint representation also does not express whether an entry is an exact host, a DNS suffix, or a complete origin. This makes it difficult to apply clear scheme and port rules to application-supplied endpoints while preserving compatibility with custom Azure environments and development endpoints.
Describe the solution you'd like
Harden and clarify trusted endpoint validation:
- Match built-in domain suffixes only when the host is exactly the suffix or ends with
"." + suffix, using ordinal case-insensitive comparison. - Normalize DNS hosts consistently, including IDN and terminal-dot handling.
- Require HTTPS for built-in Azure Key Vault and Managed HSM endpoints.
- Validate and normalize application-supplied trusted endpoints when the provider is constructed.
- Provide structured semantics for custom endpoints, distinguishing exact origins from entries that intentionally include DNS subdomains.
- Defensively copy trusted endpoint collections so validation policy cannot be changed by mutating the constructor input.
- Preserve reasonable compatibility for existing custom endpoints, with diagnostics and an explicit migration path for ambiguous legacy entries.
Add tests covering:
- Valid exact hosts and subdomains.
- Lookalike suffixes that do not share a DNS-label boundary.
- Hosts that append another DNS suffix after a trusted name.
- Mixed-case, IDN, and terminal-dot hostnames.
- HTTP, HTTPS, default ports, and explicit custom ports.
- Mutation of the input trusted-endpoint array after construction.
Describe alternatives you've considered
- Keep raw
EndsWithmatching. This retains ambiguous behavior and does not accurately model DNS domain membership. - Require exact host matching for every entry. This would not work for the built-in Azure Key Vault domains, where each vault has its own subdomain.
- Immediately reject every legacy custom endpoint format. This would provide simpler rules but could unnecessarily disrupt applications using private clouds, proxies, or development services. A compatibility-conscious migration to structured endpoint rules is preferable.
Additional context
The current built-in list covers Azure Key Vault and Managed HSM domains in public and sovereign clouds. DNS-label-boundary matching should preserve valid hostnames beneath those domains while making the allowlist behavior precise.
- Dominant language
- C#
- Stars
- 996
- Forks
- 348
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 58
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/SqlClient
-
SqlBatch.ValidateExecuteCommandBehavior XML comment says NotSupportedException but code throws ArgumentOutOfRangeExceptionPossibly taken @apoorvdeshmukh claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
dotnet/SqlClient#4823 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
Sync ExecuteReader on an STA thread deadlocks against a StateChange handler that marshals to the UI thread (OpenAsyncRetry path)May be free again @mdaigle claimed this 28 days ago, and no pull request is open. OpenExternal :link:
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
dotnet/SqlClient#4534 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
Area\Tests
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/SqlClient#4377 · 2 comments ·
Maintainers usually reply within 2 days
-
[7.0] Backport #4843Open:new: Triage Needed
Difficulty 3/5 Half a day Newbie friendliness 15/100
Maintainers usually reply within 2 days
-
[7.1] Backport #4843Possibly taken @LaurensVergote claimed this 2 days ago. Open:new: Triage Needed
Difficulty 3/5 Half a day Newbie friendliness 18/100
dotnet/SqlClient#4846 · 1 comment ·
Maintainers usually reply within 2 days
All issues in dotnet/SqlClient
Similar issues
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/semantic-kernel#14615 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
vzeol/DeployCraft#125 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fboucher/2d6-dungeon-app#245 · 1 comment ·
Maintainers usually reply within 1 day
-
area: settings good first issue priority: p2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AmineChr54/umbra#3 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day