Reject IPv6 literal URIs in name constraint checking#3045
Merged
Conversation
skmcgrail
previously approved these changes
Feb 25, 2026
samuel40791765
previously approved these changes
Mar 5, 2026
826b2ca to
8d5fa26
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3045 +/- ##
==========================================
- Coverage 78.38% 78.36% -0.02%
==========================================
Files 689 689
Lines 121200 121205 +5
Branches 16979 16982 +3
==========================================
- Hits 95001 94984 -17
- Misses 25304 25324 +20
- Partials 895 897 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sgmenda
approved these changes
Mar 6, 2026
2504ca9 to
8f2892b
Compare
skmcgrail
approved these changes
Mar 13, 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.
Description of changes:
nc_urisearches for:as a port delimiter when extracting the host from a URI. For IPv6 literals likehttps://[2001:db8::1]/, this matches the first:inside the address, truncating the host to[2001. This bug was inherited from OpenSSL 1.1.1.This change adds an explicit rejection of IPv6 literal URIs as unsupported syntax. RFC 5280 §4.2.1.10 says URI name constraints must be FQDNs anyway, and string comparison would be unreliable since the same IPv6 address can be written many different ways.
The old behavior was already fail-closed (truncated hosts never matched real constraints), so this just makes it explicit.
Call-outs:
This intentionally does not add IPv6 literal matching support — doing it correctly would require address normalization.
Testing:
Two new cases in
X509Test.NameConstraints: one well-formed and one malformed IPv6 literal URI, both expectingX509_V_ERR_UNSUPPORTED_NAME_SYNTAX. All 121 existing X509/X509Compat tests pass.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.