{"id":"CVE-2022-31027","published":"2022-06-06T21:15:12Z","modified":"2025-04-23T18:18:41Z","title":"Authorization Bypass Through User-Controlled Key when using CILogonOAuthenticator in oauthenticator","vendor":"jupyterhub","product":"oauthenticator","tier":"tail","description":{"text":"OAuthenticator is an OAuth token library for the JupyerHub login handler. CILogonOAuthenticator is provided by the OAuthenticator package, and lets users log in to a JupyterHub via CILogon. This is primarily used to restrict a JupyterHub only to users of a given institute. The allowed_idps configuration trait of CILogonOAuthenticator is documented to be a list of domains that indicate the institutions whose users are authorized to access this JupyterHub. This authorization is validated by ensuring that the *email* field provided to us by CILogon has a *domain* that matches one of the domains listed in `allowed_idps`.If `allowed_idps` contains `berkeley.edu`, you might expect only users with valid current credentials provided by University of California, Berkeley to be able to access the JupyterHub. However, CILogonOAuthenticator does *not* verify which provider is used by the user to login, only the email address provided. So a user can login with a GitHub account that has email set to `<something>@berkeley.edu`, and that will be treated exactly the same as someone logging in using the UC Berkeley official Identity Provider. The patch fixing this issue makes a *breaking change* in how `allowed_idps` is interpreted. It's no longer a list of domains, but configuration representing the `EntityID` of the IdPs that are allowed, picked from the [list maintained by CILogon](https://cilogon.org/idplist/). Users are advised to upgrade.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00475,"percentile":0.41959,"provenance":"source"},"cwes":[{"id":"CWE-639","name":"Authorization Bypass Through User-Controlled Key"}],"references":[{"url":"https://github.com/jupyterhub/oauthenticator/security/advisories/GHSA-r7v4-jwx9-wx43","tags":["x_refsource_CONFIRM"]}],"priority":{"score":11.3,"factors":[{"name":"EPSS percentile","points":8.39},{"name":"CVSS severity","points":2.94}]},"vendorSlug":"jupyterhub","affectedVersions":[{"vendor":"jupyterhub","product":"oauthenticator","versions":["< 15.0.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-23T14:05:56.695890Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"oauthenticator","vulnerableRanges":["<15.0.0"],"patched":["15.0.0"],"from":["GHSA-r7v4-jwx9-wx43","PYSEC-2022-206"],"provenance":"source"}],"summary":{"text":"The CILogonOAuthenticator component of the oauthenticator package, used for JupyterHub login, authorizes users by checking only the domain of the email address supplied by CILogon, rather than which identity provider the user actually authenticated through. An attacker with a valid account on any other provider, such as GitHub, who sets an email address under an allowed institution's domain (for example, a berkeley.edu address) can gain access to a JupyterHub restricted by allowed_idps, with the attack requiring network access and low-privilege authentication.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:01:23Z"},"euvd":{"id":"EUVD-2022-0169","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-jupyterhub-oauthenticator-cve-2018-7206","parents":[{"from":"CVE-2020-26250","to":"CVE-2022-31027","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["oauthenticator/cilogon.py","oauthenticator/oauth2.py"],"commits":["https://github.com/jupyterhub/oauthenticator/commit/a4aac191c16cf6281f3d346615aefa75702b02d7","https://github.com/jupyterhub/oauthenticator/commit/5cd2d1816f90dc5c946e6e38fd2d0ba535624c5c"],"basis":"shared function","functions":["authorize_redirect"]}]}]}}