test(idn-hostname): reject zero width space#928
Open
vtushar06 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds additional conformance coverage for the idn-hostname format by asserting that zero-width space (U+200B) is rejected across multiple JSON Schema draft test suites.
Changes:
- Added a new invalid test case for
a\u200bb(U+200B inside an IDN label) in the v1 suite. - Mirrored the same new invalid test case into draft7, draft2019-09, and draft2020-12 optional format suites.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/v1/format/idn-hostname.json | Adds U+200B “DISALLOWED” invalid-case coverage for idn-hostname. |
| tests/draft7/optional/format/idn-hostname.json | Mirrors the same U+200B invalid-case coverage for draft7 optional tests. |
| tests/draft2020-12/optional/format/idn-hostname.json | Mirrors the same U+200B invalid-case coverage for draft2020-12 optional tests. |
| tests/draft2019-09/optional/format/idn-hostname.json | Mirrors the same U+200B invalid-case coverage for draft2019-09 optional tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jviotti
approved these changes
Jun 15, 2026
jviotti
left a comment
Member
There was a problem hiding this comment.
I double checked and also looks valid to me.
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.
Following the methodology I used for ipv4 and uuid, I read RFC 5892 section 2.6 and found the current idn-hostname.json has no test for a zero width space in a label.
U+200B (ZERO WIDTH SPACE) has the DISALLOWED property under IDNA2008. UTS46 processors treat it as ignorable and silently strip it, so
a+U+200B+bbecomesaband is accepted - an invisible character that changes the resolved name.Changes
a+ U+200B +b(a zero width space between two letters) is invalid.Ecosystem Impact
idna.encoderaises InvalidCodepoint on U+200B.ab. The silent strip is also GNU libidn2 GitLab issue Create tests for new (upcoming?) meta-schema #136.RFC References
Reproduction commands and the idn-hostname cross-implementation matrix are in my evidence repo: https://github.com/vtushar06/JSON-Schema-format-test-Evidence/blob/main/idn-hostname.md
Related: #965