CVE-2024-27918 Coder's OIDC authentication allows email with partially matching domain to register

High 8.2 Published Updated

Attackers can bypass email domain restrictions to register unauthorized accounts on Coder instances using public OIDC providers.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-27918?

CVE-2024-27918 is a high-severity authentication bypass vulnerability in coder, published on 6 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-20

Which versions are affected by CVE-2024-27918?

10 open source packages ship an affected version, including github.com/coder/coder/v2 and github.com/coder/coder. It affects 1 product.

PackageAffectedFixed in
github.com/coder/coder/v2 GoAll versions2.6.1, 2.7.3, 2.8.4
github.com/coder/coder/v2 GoAll versions2.6.1
github.com/coder/coder/v2 GoAll versions2.6.1
github.com/coder/coder/v2 GoFrom 2.7.02.7.3
github.com/coder/coder/v2 GoFrom 2.7.02.7.3
github.com/coder/coder/v2 GoFrom 2.8.02.8.4
4 more packages
github.com/coder/coder/v2 GoFrom 2.8.02.8.4
github.com/coder/coder GoAll versionsNone
github.com/coder/coder GoAll versions to 0.27.3None
github.com/coder/coder GoAll versions to 0.27.3None

Products include Coder Coder.

How do I fix CVE-2024-27918?

Upgrade github.com/coder/coder/v2 to a fixed version for your release line: 2.6.1, 2.7.3 or 2.8.4.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2024-27918 being exploited?

There is no known exploitation of CVE-2024-27918 in the wild and no public exploit code.

Sources

Also known as GHSA-7cc2-r658-7xpf, GO-2024-2602.

Is CVE-2024-27918 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free