Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not decode non-ASCII-alphanumerics in Punycode labels #124

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

karwa
Copy link
Contributor

@karwa karwa commented Jan 13, 2023

Currently, invalid Punycode such as ls8h= will be successfully decoded. It should fail instead.

I think this comes about because basicToDigit was copied from C code in the punycode RFC, but that RFC uses unsigned integers, whereas JS only has signed integers (AFAIK). We need to check that the result of, say, codePoint - 0x30 is not negative -- or, as done here, check that codePoint >= 0x30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants