Skip to content

Add hostname validation to EventHub handler and update dependencies - #726

Merged
Vincenzo Caruso (vincenzocaruso) merged 3 commits into
Azure:mainfrom
rafarhat:main
Apr 14, 2026
Merged

Add hostname validation to EventHub handler and update dependencies#726
Vincenzo Caruso (vincenzocaruso) merged 3 commits into
Azure:mainfrom
rafarhat:main

Conversation

@rafarhat

Copy link
Copy Markdown
Member

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Thank you for contributing to the Azure IoT Explorer!

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • [ x] If introducing new functionality or modified behavior, are they backed by unit tests?
  • [ x] Have all unit tests passed locally? (by running npm run test command)
  • [ x] Have you updated the README.md with new screenshots if significant changes have been made?
  • [ x] Have you update the package version if the current version in package.json is not higher than the version released?

rafarhat and others added 3 commits April 14, 2026 08:11
The EventHub monitoring handler accepted user-controlled connection
strings and made AMQP connections with no hostname validation.

- Add validateEventHubHostname() for *.servicebus.windows.net endpoints
- Update validateAzureIoTHostname() to support Private Link domains
- Validate hostnames before all three network code paths:
  custom EventHub connection string, IoT Hub AMQP connection, and
  AMQP redirect response
- Apply same fixes to duplicate code in connStringHelper.ts
- Tighten client-side connection string regex (defense-in-depth)
- Exclude test files from Electron build tsconfig
- Add comprehensive unit tests for all validation paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vincenzocaruso
Vincenzo Caruso (vincenzocaruso) merged commit 730471a into Azure:main Apr 14, 2026
4 checks passed
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.

2 participants