{"id":"GHSA-r7v4-jwx9-wx43","summary":"Authorization Bypass Through User-Controlled Key when using CILogonOAuthenticator oauthenticator","details":"# Background\n\nCILogon is a federated auth provider that allows users to authenticate\nthemselves via a number of Identity Providers (IdP), focused primarily on educational and\nresearch institutions (such as Universities). More traditional and open IdPs\nsuch as GitHub, ORCID, Google, Microsoft, etc are also supported.\n\nCILogonOAuthenticator is provided by the OAuthenticator package, and lets users log\nin to a JupyterHub via CILogon. This is primarily used to restrict a JupyterHub\nonly to users of a given institute. The allowed_idps configuration trait of\nCILogonOAuthenticator is documented to be a list of domains that indicate the\ninstitutions whose users are authorized to access this JupyterHub. This authorization\nis validated by ensuring that the *email* field provided to us by CILogon has a\n*domain* that matches one of the domains listed in `allowed_idps`.\n\n# Impact\n\nIf `allowed_idps` contains `berkeley.edu`, you might expect only users with valid\ncurrent credentials provided by University of California, Berkeley to be able to\naccess the JupyterHub. However, CILogonOAuthenticator does *not* verify which provider\nis used by the user to login, only the email address provided. So a user can login\nwith a GitHub account that has email set to `\u003csomething\u003e@berkeley.edu`, and that will\nbe treated exactly the same as someone logging in using the UC Berkeley official\nIdentity Provider. This has two consequences:\n\n1. Since GitHub (and most other providers we tested) only require you to verify\n   your email once, a user can access a JupyterHub even if their access to\n   the institution's IdP has been revoked or expired.\n2. CILogon supports hundreds of identity providers - if even one of them allows\n   users to set any email ids without verifying, that can be used to impersonate\n   *any* user on any other identity provider! While CILogon itself has a stellar\n   security record, this particular method of doing authorization means an attacker\n   would only need to compromise a single identity provider to compromise all of\n   CILogon\n\nWe currently do not know of any identity provider that provides *unverified*\nemail addresses to CILogon, so this is not a severe known vulnerability. However,\nthere are hundreds of IdPs, and we could not try them all.\n\n# Patches\n\nThis patch makes a *breaking change* in how `allowed_idps` is interpreted. It's\nno longer a list of domains, but configuration representing the `EntityID` of the\nIdPs that are allowed, picked from the [list maintained by CILogon](https://cilogon.org/idplist/).\nSo instead of `berkeley.edu`, you would specify `urn:mace:incommon:berkeley.edu` to\nallow logins from users currently with `berkeley.edu` accounts. GitHub users\nwith a verified `berkeley.edu` email will no longer be allowed to log in.\n\nFor details on how to transition your CILogonOAuthenticator configuration to the patched version 15.0.0 or above, see [the migration](https://oauthenticator.readthedocs.io/en/latest/migrations.html) documentation.","aliases":["CVE-2022-31027","PYSEC-2022-206"],"modified":"2023-11-08T04:09:23.149049Z","published":"2022-06-06T21:21:40Z","database_specific":{"severity":"MODERATE","cwe_ids":["CWE-639"],"github_reviewed_at":"2022-06-06T21:21:40Z","nvd_published_at":"2022-06-09T13:15:00Z","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/jupyterhub/oauthenticator/security/advisories/GHSA-r7v4-jwx9-wx43"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31027"},{"type":"WEB","url":"https://github.com/jupyterhub/oauthenticator/commit/5cd2d1816f90dc5c946e6e38fd2d0ba535624c5c"},{"type":"PACKAGE","url":"https://github.com/jupyterhub/oauthenticator"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/oauthenticator/PYSEC-2022-206.yaml"}],"affected":[{"package":{"name":"oauthenticator","ecosystem":"PyPI","purl":"pkg:pypi/oauthenticator"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"15.0.0"}]}],"versions":["0.1.0","0.10.0","0.11.0","0.12.0","0.12.1","0.12.2","0.12.3","0.13.0","0.2.0","0.3.0","0.4.0","0.4.1","0.5.0","0.5.1","0.6.0","0.6.1","0.6.2","0.7.0","0.7.1","0.7.2","0.7.3","0.8.0","0.8.1","0.8.2","0.9.0","14.0.0","14.1.0","14.2.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/06/GHSA-r7v4-jwx9-wx43/GHSA-r7v4-jwx9-wx43.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N"}]}