Open Bug 667159 Opened 13 years ago Updated 2 months ago

Effective TLD service should reject IPv6 literals in brackets

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

People

(Reporter: dao, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-backlog])

Spun-off from bug 666706: For [::192.168.1.1], for instance, getBaseDomainFromHost returns "1.1]" rather than throwing NS_ERROR_HOST_IS_IP_ADDRESS.
Why were you passing brackets in the first place? Brackets are not considered as a part of IPv6 address. You should strip brackets before passing the address to Effective TLD service.
(In reply to comment #1)
> Why were you passing brackets in the first place?

Because that's what you get when extracting the host as illustrated in <https://developer.mozilla.org/@api/deki/files/3267/=uri-diagram.png>.

> Brackets are not
> considered as a part of IPv6 address. You should strip brackets before
> passing the address to Effective TLD service.

There's no point in doing this on the call side -- at the point where we're detecting IPv6 addresses, we know that there's no base domain, so we wouldn't call getBaseDomainFromHost.
(In reply to comment #2)
> Because that's what you get when extracting the host as illustrated in
> <https://developer.mozilla.org/@api/deki/files/3267/=uri-diagram.png>.
Actually you extracted the host using a regular expression.
https://mxr.mozilla.org/mozilla-central/source/browser/base/content/urlbarBindings.xml#205
I got "::192.168.0.1" without brackets using the following code:
> var ioService = Components.classes["@mozilla.org/network/io-service;1"]
> .getService(Components.interfaces.nsIIOService);
> var uri = ioService.newURI('http://[::192.168.0.1]/', null, null);
> console.log(uri.host);

> There's no point in doing this on the call side -- at the point where we're
> detecting IPv6 addresses, we know that there's no base domain, so we
> wouldn't call getBaseDomainFromHost.
Then why is this bug required? You do not even call the eTLD service.
(In reply to comment #3)
> (In reply to comment #2)
> > Because that's what you get when extracting the host as illustrated in
> > <https://developer.mozilla.org/@api/deki/files/3267/=uri-diagram.png>.
> Actually you extracted the host using a regular expression.
> https://mxr.mozilla.org/mozilla-central/source/browser/base/content/
> urlbarBindings.xml#205

Right, I didn't say anything contrary to this.

> I got "::192.168.0.1" without brackets using the following code:
> > var ioService = Components.classes["@mozilla.org/network/io-service;1"]
> > .getService(Components.interfaces.nsIIOService);
> > var uri = ioService.newURI('http://[::192.168.0.1]/', null, null);
> > console.log(uri.host);

Sure.

> > There's no point in doing this on the call side -- at the point where we're
> > detecting IPv6 addresses, we know that there's no base domain, so we
> > wouldn't call getBaseDomainFromHost.
> Then why is this bug required? You do not even call the eTLD service.

That's what I'm talking about. We're not calling the eTLD service anymore since we detect IPv6 addresses. Bug 666706 added this workaround.
Whiteboard: [necko-backlog]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: P1 → P3
Severity: normal → S3
Blocks: IPv6
You need to log in before you can comment on or make changes to this bug.