LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
20.31k stars 837 forks source link

IPv6 address will be converted to Punycode #942

Open RubenKelevra opened 2 months ago

RubenKelevra commented 2 months ago

I'm using Ladybird https://github.com/LadybirdBrowser/ladybird/commit/936b76f36e87a6d4cf267c15c95786ef677515fc.

While testing and discovering this bug (#941) I noticed that if I paste an IPv6-Address into the address bar with a port definition and [ and ] around the IPv6, that the address bar will momentarily convert the [ and ] characters erroneously to punycode.

As soon as you hit enter, the characters are correctly displayed as [ and ]

I thought that should probably be fixed. :)

Screenshot_20240803_083000

circl-lastname commented 2 months ago

Is issue #941 the same as this one?

RubenKelevra commented 2 months ago

@circl-lastname nope. #941 is about connectivity issues to IPv6 addresses. This one is just about cosmetics if you paste an IPv6 address into the address bar.

circl-lastname commented 2 months ago

Have you tried an IPv6 address which does not use the [] notation? It seems like it causes the RequestServer to interpret it as a domain and attempt to look it up

RubenKelevra commented 2 months ago

Why would I? This would violate the URI standard RFC 3986, as:

A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]").

Source

And Ladybird rightfully completely rejects it, if you enter an IPv6 without them:

Screencast_20240803_195222.webm

circl-lastname commented 2 months ago

Ladybird doesn't implement everything up to spec, a bit ago some basic IPv6 parsing was added, but not sure if it supports the [] notation. I'm asking if a pure IPv6 address with no port will work. Apologies as my home ISP does not provide IPv6 so I cannot check myself

RubenKelevra commented 2 months ago

Ladybird doesn't implement everything up to spec

Well, I thought that's one of the main goals of the project: To reimplement every single thing exactly to spec and complain if the spec does not work to fix the specs:

Ladybird - Ladybird browser update (July 2024)  7sDL7LRkugk - 1280x720 - 1m50s Source

Sorry if I understood something wrong there.

a bit ago some basic IPv6 parsing was added, but not sure if it supports the [] notation. I'm asking if a pure IPv6 address with no port will work. Apologies as my home ISP does not provide IPv6 so I cannot check myself

So to sum it up what is currently happening:

So this bug is about a cosmetic bug while content is pasted into the address line, if there's an IPv6 with a port specified, it doesn't seem to be recognized correctly and interpreted as other part of the URL and converted to Punycode.

All the other issue regarding not reaching IPv6 servers is in https://github.com/LadybirdBrowser/ladybird/issues/941

circl-lastname commented 2 months ago

I never said it is not the goal of the Ladybird project, I just said it has not been reached yet, and I'm trying to further identify if these issues are related, I apologize

circl-lastname commented 2 months ago

I was unaware that the [] is the only valid notation for IPv6 URLs, sorry. I was trying to determine if a plain IPv6 address would work, as plain IPv4 addresses do

xlmnxp commented 1 month ago

@RubenKelevra @circl-lastname I will look into this issue

xlmnxp commented 1 month ago

I discontinue working on this project, I will not contribute on this issue