Skip to content

Punycode domains are not properly validated #239

Closed
@karwa

Description

@karwa

Start with the input:

http://xn--ls8h/

It works, as it should, and the result is the same. It's the poop emoji, in case you were wondering. It's in the WPT tests.

Anyway, we can just start adding text to the end of this. For example:

(Input) -> (JSDOM output)

"http://xn--ls8h=/" -> "http://xn--js8hea/"
"http://xn--ls8h==/" -> "http://xn--hs8hdh/"
"http://xn--ls8h===/" -> "http://xn--gs8hcfj/"

"http://xn--ls8h===helloworldhowareyoutoday/" -> "http://xn--gs8hcaceekclworldhowareyoutoday/"
                   ^^^^^^^^^^^^^^^^^^^^^^^^                              ^^^^^^^^^^^^^^^^^^^

All of these inputs are invalid. Safari refuses to parse them, and my own IDNA implementation agrees. The tail part of the Punycode domain (after the xn--) should only consist of ASCII alphanumerics; having "=" signs in there (in the input) is clearly invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions