[JIRA] (JOIDC-57) OIDC endpoints stopped working with IPv6 after Jetty upgrade
Henri Mikkonen (Jira)
jira at shibboleth.atlassian.net
Fri Sep 17 11:51:25 UTC 2021
Henri Mikkonen ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1614c4a5-c89e-4edc-9421-990bd6ea85fd ) *created* an issue
IdP Plugin - OIDC OP ( https://shibboleth.atlassian.net/browse/JOIDC?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/JOIDC-57?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 ) JOIDC-57 ( https://shibboleth.atlassian.net/browse/JOIDC-57?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 ) OIDC endpoints stopped working with IPv6 after Jetty upgrade ( https://shibboleth.atlassian.net/browse/JOIDC-57?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 )
Issue Type: Bug Affects Versions: 2.0.0, 3.0.0, 3.0.1, 3.0.2 Assignee: Henri Mikkonen ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1614c4a5-c89e-4edc-9421-990bd6ea85fd ) Created: 17/Sep/21 7:51 AM Priority: Trivial Reporter: Henri Mikkonen ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1614c4a5-c89e-4edc-9421-990bd6ea85fd )
I was informed that the OIDC flows stopped working for IPv6 users after the Jetty servlet container was upgraded from *9.4.30.v20200611* to *9.4.43.v20210629*.
Right after receiving the OIDC authentication request message, an error page with uncaught exception is shown to the end-user and the following stack trace is produced to the logs:
2021-09-17 09:30:50,575 - ERROR [net.shibboleth.idp.plugin.oidc.op.profile:-2] - Uncaught runtime exception
java.lang.IllegalArgumentException: Invalid request URL: Invalid host: [[xxxx:xxx:xx:xxx:x:x:xxx:x]: https: //[[xxxx:xxx:xx:xxx:x:x:xxx:x]]/idp/profile/oidc/authorize
at com.nimbusds.oauth2.sdk.http.ServletUtils.createHTTPRequest(ServletUtils.java:172)
Caused by: java.net.MalformedURLException: Invalid host: [[xxxx:xxx:xx:xxx:x:x:xxx:x]
at java.base/java.net.URL.<init>(URL.java:679)
Caused by: java.lang.IllegalArgumentException: Invalid host: [[xxxx:xxx:xx:xxx:x:x:xxx:x]
at java.base/java.net.URLStreamHandler.parseURL(URLStreamHandler.java:195)
For some reason the IPv6 address contains double brackets.
We're using Nimbus code in our OIDCAuthenticationRequestDecoder (and in other OAuth2/OIDC message decoders too) for parsing the corresponding OIDC/OAuth2 message object from the incoming HttpServletRequest. The parsing contains a phase where the HttpServletRequest is transformed into a Nimbus HTTPRequest, a "format" supported by the OIDC message objects (e.g. AuthenticationRequest.parse(HTTPRequest)). The error is raised as a part of HttpServletRequest -> HTTPRequest conversion, as Nimbus:
1. Fetches the IP address of the request via HttpServletRequest.getLocalAddr()
2. Manually adds brackets to the IPv6 addresses (addresses containing ' *:* 's)
3. Builds an IP-based URL for HTTPRequest's internal purposes
It looks like the newer versions of Jetty produces IPv6 addresses with brackets, and we end up having double brackets in the IPv6 addresses.
I also filed an issue for Nimbus regarding this: https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions/issues/376/servletutilscreatehttprequest-issue-with
( https://shibboleth.atlassian.net/browse/JOIDC-57#add-comment?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JOIDC-57#add-comment?atlOrigin=eyJpIjoiOTY2NmNhMWNkOTNmNGMxMGFjYzJkMGY5NGRmZjVhNjgiLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100177- sha1:149c709 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20210917/3b6aced1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-cf70e567-645a-497a-bbda-eedd37a23226
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210917/3b6aced1/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-4fab0632-d470-466c-9ea3-77578ae60514
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210917/3b6aced1/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-bb9fc7b4-80f9-450c-b343-be07f2edd629
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210917/3b6aced1/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-514321d3-a434-4191-8229-3f8e141b6567
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210917/3b6aced1/attachment-0007.png>
More information about the commits
mailing list