8.2high
Coder's OIDC authentication allows email with partially matching domain to register
- Severity
- 8.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.97% (higher than 62% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7cc2-r658-7xpfGO-2024-2602
Description
Coder allows oragnizations to provision remote development environments via Terraform. Prior to versions 2.6.1, 2.7.3, and 2.8.4, a vulnerability in Coder's OIDC authentication could allow an attacker to bypass the `CODER_OIDC_EMAIL_DOMAIN` verification and create an account with an email not in the allowlist. Deployments are only affected if the OIDC provider allows users to create accounts on the provider. During OIDC registration, the user's email was improperly validated against the allowed `CODER_OIDC_EMAIL_DOMAIN`s. This could allow a user with a domain that only partially matched an allowed domain to successfully login or register. An attacker could register a domain name that exploited this vulnerability and register on a Coder instance with a public OIDC provider. Coder instances with OIDC enabled and protected by the `CODER_OIDC_EMAIL_DOMAIN` configuration are affected. Coder instances using a private OIDC provider are not affected, as arbitrary users cannot register through a private OIDC provider without first having an account on the provider. Public OIDC providers are impacted. GitHub authentication and external authentication are not impacted. This vulnerability is remedied in versions 2.8.4, 2.7.3, and 2.6.1 All versions prior to these patches are affected by the vulnerability.*It is recommended that customers upgrade their deployments as soon as possible if they are utilizing OIDC authentication with the `CODER_OIDC_EMAIL_DOMAIN` setting.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| coder coder | >= 2.8.0, < 2.8.4, >= 2.7.0, < 2.7.3, < 2.6.1, before 2.6.1, from 2.7.0 before 2.7.3, from 2.8.0 before 2.8.4 | CVE List, NVD |
| github.com/coder/coder/v2 (Go) | from 2.8.0 before 2.8.4, from 2.7.0 before 2.7.3, before 2.6.1 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/coder/coder (Go) | up to 0.27.3, all versions | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
| GitHub | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Coder allows oragnizations to provision remote development environments via Terraform. Prior to versions 2.6.1, 2.7.3, and 2.8.4, a vulnerability in Coder's OIDC authentication could allow an attacker to bypass the `CODER_OIDC_EMAIL_DOMAIN` verification and create an account with an email not in the allowlist. Deployments are only affected if the OIDC provider allows users to create accounts on the provider. During OIDC registration, the user's email was improperly validated against the allowed `CODER_OIDC_EMAIL_DOMAIN`s. This could allow a user with a domain that only partially matched an allowed domain to successfully login or register. An attacker could register a domain name that exploited this vulnerability and register on a Coder instance with a public OIDC provider. Coder instances with OIDC enabled and protected by the `CODER_OIDC_EMAIL_DOMAIN` configuration are affected. Coder instances using a private OIDC provider are not affected, as arbitrary users cannot register through a private OIDC provider without first having an account on the provider. Public OIDC providers are impacted. GitHub authentication and external authentication are not impacted. This vulnerability is remedied in versions 2.8.4, 2.7.3, and 2.6.1 All versions prior to these patches are affected by the vulnerability.*It is recommended that customers upgrade their deployments as soon as possible if they are utilizing OIDC authentication with the `CODER_OIDC_EMAIL_DOMAIN` setting.
GitHub Advisory Database
Summary
A vulnerability in Coder's OIDC authentication could allow an attacker to bypass the CODER_OIDC_EMAIL_DOMAIN verification and create an account with an email not in the allowlist. Deployments are only affected if the OIDC provider allows users to create accounts on the provider (such as public providers like google.com).
Details
During OIDC registration, the user's email was improperly validated against the allowed CODER_OIDC_EMAIL_DOMAINs. This could allow a user with a domain that only partially matched an allowed domain to successfully login or register (e.g. user@exploitcorp.com would match the allowed domain corp.com).
An attacker could register a domain name that exploited this vulnerability and register on a Coder instance with a public OIDC provider.
Impact
Coder instances with OIDC enabled and protected by the CODER_OIDC_EMAIL_DOMAIN configuration.
Coder instances using a private OIDC provider are not affected, as arbitrary users cannot register through a private OIDC provider without first having an account on the provider.
Public OIDC providers (such as google.com without permitted domains set on the OAuth2 App) are impacted.
GitHub authentication and external authentication are not impacted.
Was my deployment impacted?
To check if your deployment was exploited:
- View the audit log on your deployment for unexpected registered users (using the
action:registerfilter) - Check the users list for unexpected users
- Users created via this exploit will have a domain that ends with one of the allowed domains but doesn’t fully match (e.g.
@exploitcorp.cominstead of@corp.com)
- Users created via this exploit will have a domain that ends with one of the allowed domains but doesn’t fully match (e.g.
Patched Versions
This vulnerability is remedied in
- v2.8.4
- v2.7.3
- v2.6.1
All versions prior to these patches are affected by the vulnerability. It is recommended that customers upgrade their deployments as soon as possible if they are utilizing OIDC authentication with the CODER_OIDC_EMAIL_DOMAIN setting.
Thanks
References
https://github.com/coder/coder/security/advisories/GHSA-7cc2-r658-7xpf https://github.com/coder/coder/commit/4439a920e454a82565e445e4376c669e3b89591c https://nvd.nist.gov/vuln/detail/CVE-2024-27918
Go Vulnerability Database
A vulnerability in Coder's OIDC authentication could allow an attacker to bypass the CODER_OIDC_EMAIL_DOMAIN verification and create an account with an email not in the allowlist. Deployments are only affected if the OIDC provider allows users to create accounts on the provider (such as public providers like google.com). During OIDC registration, the user's email was improperly validated against the allowed CODER_OIDC_EMAIL_DOMAINs.
NVD (es)
Coder permite a las organizaciones aprovisionar entornos de desarrollo remotos a través de Terraform. Antes de las versiones 2.6.1, 2.7.3 y 2.8.4, una vulnerabilidad en la autenticación OIDC de Coder podía permitir a un atacante eludir la verificación `CODER_OIDC_EMAIL_DOMAIN` y crear una cuenta con un correo electrónico que no estaba en la lista de permitidos. Las implementaciones solo se ven afectadas si el proveedor de OIDC permite a los usuarios crear cuentas en el proveedor. Durante el registro de OIDC, el correo electrónico del usuario se validó incorrectamente con los `CODER_OIDC_EMAIL_DOMAIN`s permitidos. Esto podría permitir que un usuario con un dominio que solo coincidiera parcialmente con un dominio permitido inicie sesión o se registre exitosamente. Un atacante podría registrar un nombre de dominio que explotara esta vulnerabilidad y registrarse en una instancia de Coder con un proveedor público de OIDC. Las instancias de Coder con OIDC habilitado y protegido por la configuración `CODER_OIDC_EMAIL_DOMAIN` se ven afectadas. Las instancias de Coder que utilizan un proveedor OIDC privado no se ven afectadas, ya que los usuarios arbitrarios no pueden registrarse a través de un proveedor OIDC privado sin tener primero una cuenta en el proveedor. Los proveedores públicos de OIDC se ven afectados. La autenticación de GitHub y la autenticación externa no se ven afectadas. Esta vulnerabilidad se soluciona en las versiones 2.8.4, 2.7.3 y 2.6.1. Todas las versiones anteriores a estos parches se ven afectadas por la vulnerabilidad. *Se recomienda que los clientes actualicen sus implementaciones lo antes posible si utilizan autenticación OIDC con la configuración `CODER_OIDC_EMAIL_DOMAIN`.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-27918 changed 2024-08-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7cc2-r658-7xpf changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-2602 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2024-27918 changed 2026-06-17 | Public domain |