github.com/coder/coder/v2

CVE-2024-27918

CVE-2024-27918 is a high-severity improper input validation vulnerability in github.com/coder/coder/v2 (go), affecting versions >= 2.8.0, < 2.8.4. It is fixed in 2.8.4, 2.7.3, 2.6.1.

Key facts
CVSS score
8.2
High
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
github.com/coder/coder/v2
Fixed in
2.8.4, 2.7.3, 2.6.1
Disclosed
2024

Summary

Summary A vulnerability in Coder's OIDC authentication could allow an attacker to bypass the CODEROIDCEMAILDOMAIN 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 CODEROIDCEMAILDOMAINs. This could allow a user with a domain that only partially matched an allowed domain to successfully login or register (e.g. [email protected] 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 CODEROIDCEMAILDOMAIN 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:register filter) 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.com instead of @corp.com) 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 CODEROIDCEMAILDOMAIN setting. Thanks https://github.com/arcz https://www.trailofbits.com 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

Impact

What is improper input validation?

The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.

Severity and exposure

CVE-2024-27918 has a CVSS score of 8.2 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (2.8.4, 2.7.3, 2.6.1). Upgrading removes the vulnerable code path.

Affected versions

go

  • github.com/coder/coder/v2 (>= 2.8.0, < 2.8.4)
  • github.com/coder/coder/v2 (>= 2.7.0, < 2.7.3)
  • github.com/coder/coder/v2 (< 2.6.1)
  • github.com/coder/coder (<= 0.27.3)

Security releases

  • github.com/coder/coder/v2 → 2.8.4 (go)
  • github.com/coder/coder/v2 → 2.7.3 (go)
  • github.com/coder/coder/v2 → 2.6.1 (go)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2024-27918 is reachable in your applications. Explore open-source security for your team.

See if CVE-2024-27918 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2024-27918 in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

  • Upgrade github.com/coder/coder/v2 to 2.8.4 or later
  • Upgrade github.com/coder/coder/v2 to 2.7.3 or later
  • Upgrade github.com/coder/coder/v2 to 2.6.1 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2024-27918

What is CVE-2024-27918?

CVE-2024-27918 is a high-severity improper input validation vulnerability in github.com/coder/coder/v2 (go), affecting versions >= 2.8.0, < 2.8.4. It is fixed in 2.8.4, 2.7.3, 2.6.1. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.

How severe is CVE-2024-27918?

CVE-2024-27918 has a CVSS score of 8.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which packages are affected by CVE-2024-27918?
  • github.com/coder/coder/v2 (go) (versions >= 2.8.0, < 2.8.4)
  • github.com/coder/coder (go) (versions <= 0.27.3)
Is there a fix for CVE-2024-27918?

Yes. CVE-2024-27918 is fixed in 2.8.4, 2.7.3, 2.6.1. Upgrade to this version or later.

Is CVE-2024-27918 exploitable, and should I be worried?

Whether CVE-2024-27918 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2024-27918 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2024-27918?
  • Upgrade github.com/coder/coder/v2 to 2.8.4 or later
  • Upgrade github.com/coder/coder/v2 to 2.7.3 or later
  • Upgrade github.com/coder/coder/v2 to 2.6.1 or later

Stop the waste.
Protect your environment with Kodem.