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.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Coder's OIDC authentication allows email with partially matching domain to register

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

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

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.

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.

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

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. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade the following packages to resolve this vulnerability:

github.com/coder/coder/v2 to 2.8.4 or later; github.com/coder/coder/v2 to 2.7.3 or later; 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

  1. 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.
  2. 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.
  3. 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)
  4. 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.
  5. 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
  6. 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.
  7. 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

Other vulnerabilities in github.com/coder/coder/v2

Stop the waste.
Protect your environment with Kodem.