Skip to content

Conversation

@bagder
Copy link
Member

@bagder bagder commented Dec 8, 2025

A hostname cannot start with a dot when DNS is used, but there are other ways.

Amend unit test 1397

A hostname cannot start with a dot when DNS is used, but there are other
ways.

Amend unit test 1397
@bagder bagder added the TLS label Dec 8, 2025
@bagder bagder marked this pull request as ready for review December 8, 2025 09:20
@github-actions github-actions bot added the tests label Dec 8, 2025
@bagder bagder requested a review from Copilot December 8, 2025 09:30
@bagder
Copy link
Member Author

bagder commented Dec 8, 2025

augment review

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link

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

This PR enhances hostname validation in wildcard certificate matching by explicitly rejecting hostnames that start with a dot. While such hostnames are invalid in DNS, they could potentially be used in other contexts, so this change adds an extra security measure to the wildcard matching logic.

  • Adds explicit check to reject hostnames starting with a dot in wildcard pattern matching
  • Updates the comment to reflect the new validation rule
  • Adds test cases to verify the new behavior

Reviewed changes

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

File Description
lib/vtls/hostcheck.c Adds validation to reject hostnames starting with a dot in wildcard certificate matching, updating the check at line 96 and its associated comment
tests/unit/unit1397.c Adds two test cases at the beginning of the test array to verify that hostnames starting with a dot are rejected while normal hostnames continue to match correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 2535c42 Dec 8, 2025
@bagder bagder deleted the bagder/dot-first-hostmatch branch December 8, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant