GHSA-pwh8-58vv-vw48

Suggest an improvement
Source
https://github.com/advisories/GHSA-pwh8-58vv-vw48
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/09/GHSA-pwh8-58vv-vw48/GHSA-pwh8-58vv-vw48.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-pwh8-58vv-vw48
Aliases
Related
Published
2023-09-15T13:36:10Z
Modified
2024-09-10T17:34:58.301419Z
Severity
  • 3.5 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N CVSS Calculator
Summary
Jetty's OpenId Revoked authentication allows one request
Details

If a Jetty OpenIdAuthenticator uses the optional nested LoginService, and that LoginService decides to revoke an already authenticated user, then the current request will still treat the user as authenticated. The authentication is then cleared from the session and subsequent requests will not be treated as authenticated.

So a request on a previously authenticated session could be allowed to bypass authentication after it had been rejected by the LoginService.

Impact

This impacts usages of the jetty-openid which have configured a nested LoginService and where that LoginService will is capable of rejecting previously authenticated users.

Original Report

working on a custom OpenIdAuthenticator, I discovered the following:

https://github.com/eclipse/jetty.project/blob/jetty-10.0.14/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java#L505

In the case where the LoginService does return that the authentication has been revoked (from the validate() call on line 463), the OpenIdAuthenticator removes the authentication from the session; however the current request still proceeds as if authenticated, since it falls through to "return authentication" on line 505.

This is fixed by moving the line 505 (and associated debug log) inside the else block that ends on line 502, instead of outside it. Then the revocation case will run through to line 517 and will trigger a new OpenId authentication which I think is correct.

I think this revocation can only occur if you do attach a separate LoginService to the OpenIdLoginService, but in that case the revoked authentication will still let the next request through (and possibly more than one if they are very close to simultaneous).

Technically I think this is a security vulnerability, if a very minor one, so I'm sending this off-list.

Patched Versions

Fixed in Jetty Versions: * 9.4.52 - fixed in PR https://github.com/eclipse/jetty.project/pull/9660 * 10.0.16 - fixed in PR https://github.com/eclipse/jetty.project/pull/9528 * 11.0.16 - fixed in PR https://github.com/eclipse/jetty.project/pull/9528 * 12.0.0 - not impacted (already has fix)

Workaround

Upgrade your version of Jetty.

References

  • https://github.com/eclipse/jetty.project/pull/9528
  • https://github.com/eclipse/jetty.project/pull/9660
Database specific
{
    "nvd_published_at": "2023-09-15T21:15:11Z",
    "cwe_ids": [
        "CWE-1390",
        "CWE-287"
    ],
    "severity": "LOW",
    "github_reviewed": true,
    "github_reviewed_at": "2023-09-15T13:36:10Z"
}
References

Affected packages

Maven / org.eclipse.jetty:jetty-openid

Package

Name
org.eclipse.jetty:jetty-openid
View open source insights on deps.dev
Purl
pkg:maven/org.eclipse.jetty/jetty-openid

Affected ranges

Type
ECOSYSTEM
Events
Introduced
9.4.21
Fixed
9.4.52.v20230823

Affected versions

9.*

9.4.21.v20190926
9.4.22.v20191022
9.4.23.v20191118
9.4.24.v20191120
9.4.25.v20191220
9.4.26.v20200117
9.4.27.v20200227
9.4.28.v20200408
9.4.29.v20200521
9.4.30.v20200611
9.4.31.v20200723
9.4.32.v20200930
9.4.33.v20201020
9.4.34.v20201102
9.4.35.v20201120
9.4.36.v20210114
9.4.37.v20210219
9.4.38.v20210224
9.4.39.v20210325
9.4.40.v20210413
9.4.41.v20210516
9.4.42.v20210604
9.4.43.v20210629
9.4.44.v20210927
9.4.45.v20220203
9.4.46.v20220331
9.4.47.v20220610
9.4.48.v20220622
9.4.49.v20220914
9.4.50.v20221201
9.4.51.v20230217

Database specific

{
    "last_known_affected_version_range": "<= 9.4.51"
}

Maven / org.eclipse.jetty:jetty-openid

Package

Name
org.eclipse.jetty:jetty-openid
View open source insights on deps.dev
Purl
pkg:maven/org.eclipse.jetty/jetty-openid

Affected ranges

Type
ECOSYSTEM
Events
Introduced
10.0.0
Fixed
10.0.16

Affected versions

10.*

10.0.0
10.0.1
10.0.2
10.0.3
10.0.4
10.0.5
10.0.6
10.0.7
10.0.8
10.0.9
10.0.10
10.0.11
10.0.12
10.0.13
10.0.14
10.0.15

Database specific

{
    "last_known_affected_version_range": "<= 10.0.15"
}

Maven / org.eclipse.jetty:jetty-openid

Package

Name
org.eclipse.jetty:jetty-openid
View open source insights on deps.dev
Purl
pkg:maven/org.eclipse.jetty/jetty-openid

Affected ranges

Type
ECOSYSTEM
Events
Introduced
11.0.0
Fixed
11.0.16

Affected versions

11.*

11.0.0
11.0.1
11.0.2
11.0.3
11.0.4
11.0.5
11.0.6
11.0.7
11.0.8
11.0.9
11.0.10
11.0.11
11.0.12
11.0.13
11.0.14
11.0.15

Database specific

{
    "last_known_affected_version_range": "<= 11.0.15"
}