GHSA-R7V4-JWX9-WX43
Vulnerability from github – Published: 2022-06-06 21:21 – Updated: 2022-06-06 21:21Background
CILogon is a federated auth provider that allows users to authenticate themselves via a number of Identity Providers (IdP), focused primarily on educational and research institutions (such as Universities). More traditional and open IdPs such as GitHub, ORCID, Google, Microsoft, etc are also supported.
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.
Impact
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. This has two consequences:
- Since GitHub (and most other providers we tested) only require you to verify your email once, a user can access a JupyterHub even if their access to the institution's IdP has been revoked or expired.
- CILogon supports hundreds of identity providers - if even one of them allows users to set any email ids without verifying, that can be used to impersonate any user on any other identity provider! While CILogon itself has a stellar security record, this particular method of doing authorization means an attacker would only need to compromise a single identity provider to compromise all of CILogon
We currently do not know of any identity provider that provides unverified email addresses to CILogon, so this is not a severe known vulnerability. However, there are hundreds of IdPs, and we could not try them all.
Patches
This patch 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.
So instead of berkeley.edu, you would specify urn:mace:incommon:berkeley.edu to
allow logins from users currently with berkeley.edu accounts. GitHub users
with a verified berkeley.edu email will no longer be allowed to log in.
For details on how to transition your CILogonOAuthenticator configuration to the patched version 15.0.0 or above, see the migration documentation.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "oauthenticator"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "15.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-31027"
],
"database_specific": {
"cwe_ids": [
"CWE-639"
],
"github_reviewed": true,
"github_reviewed_at": "2022-06-06T21:21:40Z",
"nvd_published_at": "2022-06-09T13:15:00Z",
"severity": "MODERATE"
},
"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\u0027s 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\u0027s\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.",
"id": "GHSA-r7v4-jwx9-wx43",
"modified": "2022-06-06T21:21:40Z",
"published": "2022-06-06T21:21:40Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Authorization Bypass Through User-Controlled Key when using CILogonOAuthenticator oauthenticator"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.