ghsa-pwh8-58vv-vw48
Vulnerability from github
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
{ "affected": [ { "database_specific": { "last_known_affected_version_range": "\u003c= 9.4.51" }, "package": { "ecosystem": "Maven", "name": "org.eclipse.jetty:jetty-openid" }, "ranges": [ { "events": [ { "introduced": "9.4.21" }, { "fixed": "9.4.52.v20230823" } ], "type": "ECOSYSTEM" } ] }, { "database_specific": { "last_known_affected_version_range": "\u003c= 10.0.15" }, "package": { "ecosystem": "Maven", "name": "org.eclipse.jetty:jetty-openid" }, "ranges": [ { "events": [ { "introduced": "10.0.0" }, { "fixed": "10.0.16" } ], "type": "ECOSYSTEM" } ] }, { "database_specific": { "last_known_affected_version_range": "\u003c= 11.0.15" }, "package": { "ecosystem": "Maven", "name": "org.eclipse.jetty:jetty-openid" }, "ranges": [ { "events": [ { "introduced": "11.0.0" }, { "fixed": "11.0.16" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2023-41900" ], "database_specific": { "cwe_ids": [ "CWE-1390", "CWE-287" ], "github_reviewed": true, "github_reviewed_at": "2023-09-15T13:36:10Z", "nvd_published_at": "2023-09-15T21:15:11Z", "severity": "LOW" }, "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. \n\nSo a request on a previously authenticated session could be allowed to bypass authentication after it had been rejected by the `LoginService`.\n\n### Impact\nThis impacts usages of the jetty-openid which have configured a nested `LoginService` and where that `LoginService` will is capable of rejecting previously authenticated users.\n\n### Original Report\n\u003e working on a custom OpenIdAuthenticator, I discovered the following:\n\u003e \n\u003e https://github.com/eclipse/jetty.project/blob/jetty-10.0.14/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java#L505\n\u003e \n\u003e 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.\n\u003e \n\u003e 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.\n\u003e \n\u003e 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).\n\u003e \n\u003e Technically I think this is a security vulnerability, if a very minor one, so I\u0027m sending this off-list.\n\n### Patched Versions\n\nFixed in Jetty Versions:\n* 9.4.52 - fixed in PR https://github.com/eclipse/jetty.project/pull/9660\n* 10.0.16 - fixed in PR https://github.com/eclipse/jetty.project/pull/9528\n* 11.0.16 - fixed in PR https://github.com/eclipse/jetty.project/pull/9528\n* 12.0.0 - not impacted (already has fix)\n\n### Workaround\nUpgrade your version of Jetty.\n\n### References\n* https://github.com/eclipse/jetty.project/pull/9528\n* https://github.com/eclipse/jetty.project/pull/9660", "id": "GHSA-pwh8-58vv-vw48", "modified": "2024-09-10T17:15:25Z", "published": "2023-09-15T13:36:10Z", "references": [ { "type": "WEB", "url": "https://github.com/eclipse/jetty.project/security/advisories/GHSA-pwh8-58vv-vw48" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-41900" }, { "type": "WEB", "url": "https://github.com/eclipse/jetty.project/pull/9528" }, { "type": "WEB", "url": "https://github.com/eclipse/jetty.project/pull/9660" }, { "type": "PACKAGE", "url": "https://github.com/eclipse/jetty.project" }, { "type": "WEB", "url": "https://security.netapp.com/advisory/ntap-20231110-0004" }, { "type": "WEB", "url": "https://www.debian.org/security/2023/dsa-5507" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N", "type": "CVSS_V3" } ], "summary": "Jetty\u0027s OpenId Revoked authentication allows one request" }
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.