strip all trailing dots in name-constraint host canonicalization - #2436
Open
rootvector2 wants to merge 1 commit into
Open
strip all trailing dots in name-constraint host canonicalization#2436rootvector2 wants to merge 1 commit into
rootvector2 wants to merge 1 commit into
Conversation
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.
PKIXNameConstraintValidator.stripTrailingDotremoved only one RFC 1034 root-label dot, so adNSName,rfc822Namehost oruniformResourceIdentifierhost carrying two or more trailing dots kept a phantom empty label after the strip and missed the exact-match check. a SAN such asexample.com..is a legalIA5Stringthe certificate parser never validates for DNS well-formedness, so it reaches the validator unchanged and escapes an excludedexample.comsubtree (RFC 5280 sec. 4.2.1.10). the same helper is shared by the email and URI host paths, soceo@bank.com..andhttps://competitor.example../escape the same way. found while extending the single-dottestTrailingDotBypasscase that already guards this class.stripTrailingDotnow strips every trailing dot, keeping the lower bound of 1 that preserves a bare.. one change closes thedNSName,rfc822Nameand URI paths at once; single-dot handling and sibling-domain non-matching are unchanged.PKIXNameConstraintsTest.testTrailingDotBypassgains double- and triple-dot cases for each path, and fails without this change.AI tooling was used to help prepare this change.