x/net/idna: ToUnicode does not correctly handle labels with mixed/uppercase ACE prefixes #48778
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Passing a domain label with a mixed-case (e.g.,
xN--
) or uppercase (XN--
) IDNA ACE prefix is not processed byidna.ToUnicode
in the same manner as lowercase (xn--
). According to Section 2.3.1 of RFC 5890, XN-labels are "the class of labels that begin with the prefix "xn--" (case independent), but otherwise conform to the rules for LDH labels." Given this, it appears thatidna.ToUnicode
incorrectly uses a case sensitive comparsion when determining whether a label is a XN-label or not.See https://play.golang.org/p/8Fp648egSFC for a minimal program reproducing the issue.
What did you expect to see?
In the repro linked above, the program should execute successfully to completion (the error in the "Fake A-label", regardless of ACE prefix casing, is correctly returned in both case).
What did you see instead?
For the fake A-label with a mixed case ACE prefix, no error is returned. This is incorrect according to section 2.3.1 of RFC 5890, referenced above.
The text was updated successfully, but these errors were encountered: