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

:authority header for IPv6 address not having square brackets #5079

Closed
lubinson opened this issue Jul 26, 2020 · 5 comments · Fixed by #5128
Closed

:authority header for IPv6 address not having square brackets #5079

lubinson opened this issue Jul 26, 2020 · 5 comments · Fixed by #5128
Assignees

Comments

@lubinson
Copy link

Jetty version
9.4.30.v20200611
Java version
11
OS type/version

Description
The :authority header Jetty Http Client send out for IPv6 endpoint is
:authority: 2356:0102:3238:3876:1122:2232:4321:80
As per the IPv6 host literal the value should be
[2356:0102:3238:3876:1122:2232:4321]:80

@sbordet
Copy link
Contributor

sbordet commented Jul 26, 2020

As per the IPv6 host literal the value should be bracketed

AFAIK, the square brackets for IPv6 addresses are only needed in URIs.

I'm not aware of the IETF IPv6 specification to mandate square brackets and I don't think they should be sent in the HTTP/2 :authority pseudo header.

I know of HTTP/2 deployments over IPv6 and we have not had reports of problems for lack of square brackets in :authority.

Do you have any authoritative reference or interoperability issue that confirms the problem?

@joakime
Copy link
Contributor

joakime commented Jul 26, 2020

What does curl produce when you force http2 and ipv6?

curl -vvvv --http2 --ipv6 ...

@lubinson
Copy link
Author

@sbordet

Thanks for your response.
Please refer https://tools.ietf.org/html/rfc7540#section-8.1.2.3 for the :authority header definition and it refer to the https://tools.ietf.org/html/rfc3986#section-3.2 for Authority definition and https://tools.ietf.org/html/rfc3986#section-3.2.2 for the Host segment in the Authority which the Host format as:
IP-literal = "[" ( IPv6address / IPvFuture ) "]"

@sbordet
Copy link
Contributor

sbordet commented Jul 26, 2020

I verified that curl sends :authority with value [::1]:8080.
The server is able to parse that correctly through class HostPort, which accepts also IPv6 without brackets.

The client should also take into account CONNECT requests that have an authority request-target, and take into account the behavior mandated by RFC 8441.

@sbordet
Copy link
Contributor

sbordet commented Aug 5, 2020

See #1503.

sbordet added a commit that referenced this issue Aug 10, 2020
…ackets.

Fixed Jenkins failures by disabling tests that require IPv6 if it is not available.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 11, 2020
…ackets.

Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 11, 2020
…ackets.

Reverted code changes to HttpClient.normalizeHost().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added a commit that referenced this issue Aug 11, 2020
Fixes #5079 - :authority header for IPv6 address not having square br…
@joakime joakime added this to To do in Jetty 9.4.32 via automation Aug 11, 2020
@joakime joakime moved this from To do to Done in Jetty 9.4.32 Aug 11, 2020
paulmillar added a commit to paulmillar/dcache that referenced this issue Nov 16, 2020
Motivation:

Commit 8e4d90e merged commit c0e8abf from dependabot[bot]
<support@github.com> that resolves a security vulnerability by bumping
the Jetty version from 9.4.18.v20190429 to 9.4.34.v20201102.

This new version of Jetty resolves issue jetty/jetty.project#5079,
with the effect that HttpServletRequest#getRemoteAddr now returns IPv6
addresses in square brackets.

Previously, the getRemoteAddr method returned IPv6 addresses without
square brackets.

The change in format means that calling InetAddresses.forString throws
an IllegalArgumentException if dCache's WebDAV or frontend is used with
an IPv6 address.

Modification:

Update Guava usage to a method that expects IPv6 addresses in square
brackets.

Result:

dCache WebDAV and frontend now work with IPv6 interfaces.

Target: master
Requires-notes: no
Requires-book: no
paulmillar added a commit to dCache/dcache that referenced this issue Nov 18, 2020
Motivation:

Commit 8e4d90e merged commit c0e8abf from dependabot[bot]
<support@github.com> that resolves a security vulnerability by bumping
the Jetty version from 9.4.18.v20190429 to 9.4.34.v20201102.

This new version of Jetty resolves issue jetty/jetty.project#5079,
with the effect that HttpServletRequest#getRemoteAddr now returns IPv6
addresses in square brackets.  Previously, the getRemoteAddr method
returned IPv6 addresses without square brackets.

The result of this change in format means that calling Guava's
InetAddresses.forString now throws an IllegalArgumentException if
dCache's WebDAV or frontend is used with an IPv6 address.

Modification:

Update Guava usage to a method that expects IPv6 addresses in square
brackets.

Result:

dCache WebDAV and frontend now work with IPv6 interfaces.

Target: master
Requires-notes: no
Requires-book: no
Patch: https://rb.dcache.org/r/12671/
Acked-by: Tigran Mkrtchyan
Acked-by: Lea Morschel
@gregw gregw mentioned this issue Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Jetty 9.4.32
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants