Skip to content

x/net/idna: VerifyDNSLength is not rejecting empty labels #58778

Open
@zeroizerz

Description

@zeroizerz

What did you do?

https://go.dev/play/p/YZC2LJAeSLm

What did you expect to see?

Result consistent with https://unicode.org/reports/tr46/#ToASCII

If the VerifyDnsLength flag is true, then verify DNS length restrictions.

The length of each label is from 1 to 63.

profile.ToASCII(www..com.) = www..com. idna: invalid label "www..com."
profile.ToASCII(www..ćóḿ.) = www..xn--kda3b580m. idna: invalid label "www..ćóḿ."
profile.ToASCII(www.example..) = www.example.. idna: invalid label ""
profile.ToASCII(www.éxamplé..) = www.xn--xampl-9raf.. idna: invalid label ""

What did you see instead?

profile.ToASCII(www..com.) = www..com. idna: invalid label "www..com."
profile.ToASCII(www..ćóḿ.) = www..xn--kda3b580m. idna: invalid label "www..ćóḿ."
profile.ToASCII(www.éxamplé..) = www.xn--xampl-9raf.. idna: invalid label ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions