-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
net/http: use nontransitional IDNA processing #46001
Comments
@ianlancetaylor possible proposal? |
I'll let net/http maintainers comment. |
Empirical testing of navigating to http://straße.de/ in various browsers (version whatever was installed on the machine closest to me at the time):
My most-convenient Linux box has There appears to be no consistency in browser behavior. However, given that:
it seems reasonable to me to change the Marking this as a proposal. cc @FiloSottile for possible security considerations. |
I wouldn’t go as far as calling the current behavior a security vulnerability, but unexpected and spec-divergent behavior is a security liability, so I generally support the change. This fits in a pattern of implementation choices that haven’t kept up with the changing ecosystem, to the point of becoming dangerously idiosyncratic (like most recently semicolons in URL queries). We don’t have an exception for them in the Compatibility Promise, but maybe we should discuss adding one to ensure the Go standard library doesn’t become riddled with legacy surprising behaviors. By the way, if we make this change, we should document not only the new behavior but also how it will change and will be kept up to date. |
What is Chrome's rationale for not making this change? |
FYI: There have been multiple issues on Chromium over the years about transitional v.s. non-transitional processings. The latest issue (that was not merged, blocked, or closed) is https://bugs.chromium.org/p/chromium/issues/detail?id=694157 There was an older one closed as WONTFIX: https://bugs.chromium.org/p/chromium/issues/detail?id=505262 |
I have not been able to find a conclusive rationale for Chrome not making this change. That doesn't mean there isn't one, of course, just that I can't find it. So far as I can tell, the primary concern that led to the introduction of transitional processing is that the case-insensitivity of domain names introduces an ambiguity: Uppercase Of course, the current situation is that lowercase
We currently document that the I don't know what a good policy for future changes would be. It seems to me that the lack of a clearly correct policy has led to the current fragmentation between browsers. A simple and clear one for us would be to defer the decision to some other party--e.g., always do what Chrome does by default. |
Agreeing with Chrome carries a lot of weight with me. |
In case it helps, the Chrome team considers the current behavior (and any other misalignments with the URL Standard) to be a bug. You can track our meta-bug for this effort at https://bugs.chromium.org/p/chromium/issues/detail?id=660384. |
Considering it a bug and considering it appropriate to change are clearly two different things, and it appears that for now at least Chrome does not consider it appropriate to change. The specific issue for nontransitional IDNA seems to be https://bugs.chromium.org/p/chromium/issues/detail?id=694157. I'm still reluctant to make the change before Chrome. There must be a reason they haven't done it yet. |
The reason is engineering resources. (Perhaps I wasn't clear; I'm a member of the Chrome team.) |
Understood, but why is the change costly in engineering resources? It should be something like a 1-line change, no? |
@domenic is there a planned Chrome milestone when a conversion will happen? |
There is no planned milestone; as I said this is not something we're devoting engineering resources to. There's no significant concern about the change since we would be matching Safari and the spec. |
Thanks @domenic. If there's no significant concern then maybe we should just make the change. |
This sounds like a likely accept, implemented by also accepting and implementing #47510 (changing the default). |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
This is blocked by #30940. We cannot properly choose between transitional/nontransitional right now. |
Change https://golang.org/cl/359634 mentions this issue: |
Updates golang/go#46001 Updates golang/go#47510 Change-Id: I1e978a3c6230abfd0b1aaab0c7343b33dda1ba64 Reviewed-on: https://go-review.googlesource.com/c/text/+/359634 Trust: Damien Neil <[email protected]> Run-TryBot: Damien Neil <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Timothy Gu <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Change https://golang.org/cl/360381 mentions this issue: |
CL 359634: use nontransitional processing in Go 1.18 CL 317731: fix int32 overflows Updates golang/go#46001 Updates golang/go#47510 Updates golang/go#28233 Change-Id: I2d9cdf5caa44f7c9b2834a256e7464b6edaae9ef Reviewed-on: https://go-review.googlesource.com/c/net/+/360381 Trust: Damien Neil <[email protected]> Run-TryBot: Damien Neil <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
This has been fixed in 77c473f. |
Change https://golang.org/cl/366955 mentions this issue: |
Change https://go.dev/cl/389955 mentions this issue: |
Based on CL 366955 originally by Timothy Gu. For golang/go#46001 For golang/go#47694 Change-Id: Ide7711680d651c4cbbb6da13ab33b67cf5e26758 Reviewed-on: https://go-review.googlesource.com/c/website/+/389955 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Trust: DO NOT USE <[email protected]>
Updates golang/go#46001 Updates golang/go#47510 Change-Id: I1e978a3c6230abfd0b1aaab0c7343b33dda1ba64 Reviewed-on: https://go-review.googlesource.com/c/text/+/359634 Trust: Damien Neil <[email protected]> Run-TryBot: Damien Neil <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Timothy Gu <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Based on CL 366955 originally by Timothy Gu. For golang/go#46001 For golang/go#47694 Change-Id: Ide7711680d651c4cbbb6da13ab33b67cf5e26758 Reviewed-on: https://go-review.googlesource.com/c/website/+/389955 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Trust: DO NOT USE <[email protected]>
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?
What did you expect to see?
straße.de should get resolved to xn--strae-oqa per IDNA Nontransitional processing and DENIC announcement. This is the case on Firefox and Safari when you type the URL into the address bar. It is also the behavior of curl, wget, Node.js, and the browser WHATWG URL Standard.
What did you see instead?
straße.de got resolved instead to strasse.de. This is the current behavior in Chrome, and from what Ryan Sleevi implied in https://crbug.com/694157, other pieces of Google software as well. (The same behavior is in Python as well, but that's a bit unfair, since Python's IDNA encoding is effectively frozen to IDNA 2003.)
Discussion
Which way to go here is ultimately a policy change. The arguments for keeping transitional processing are:
The arguments for moving to nontransitional processing are:
It appears to me that implementing things from web standards and first principles is part of the Go ethos, which would lean in favor of using nontransitional processing. However, maintaining compatibility is also a powerful motivation.
The text was updated successfully, but these errors were encountered: