test(idn-hostname): reject A-labels that decode to an invalid U-label#935
Open
vtushar06 wants to merge 2 commits into
Open
test(idn-hostname): reject A-labels that decode to an invalid U-label#935vtushar06 wants to merge 2 commits into
vtushar06 wants to merge 2 commits into
Conversation
jdesrosiers
approved these changes
Jun 19, 2026
jdesrosiers
left a comment
Member
There was a problem hiding this comment.
👍
We cover this in hostname.json, but it's completely missing in idn-hostname.json.
Member
|
Needs rebase. |
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 5890 section 2.3.2.1 and found the current idn-hostname.json tests Punycode validity but never an A-label that decodes to an invalid U-label.
A string is only an A-label if it decodes to a valid U-label. A validator that accepts any well-formed
xn--without decoding and re-checking the result will accept labels whose U-label is invalid.Changes
xn--7adecodes to U+00A1, which is DISALLOWED (RFC 5892 section 2.6) - invalid.xn--0ca24wdecodes to a-grave + Hebrew aleph, which violates the Bidi rule (RFC 5893) - invalid.Ecosystem Impact
idna.encodedecodes and re-validates.xn--7a(accept it). Node also FAILSxn--0ca24w.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