CVE-2024-27918: Github.com/coder/coder/v2 Coder's OIDC Authentication Allows Email Vulnerability
HIGHCVE-2024-27918 is a HIGH (CVSS 8.2) coder's oidc authentication allows email vulnerability (CWE-20: Improper Input Validation) affecting Github.com/coder/coder/v2 libraries in the Go ecosystem. The issue involves coder's oidc authentication allows email with partially matching domain to register. Remediation is available by upgrading affected packages to version 2.8.4, 2.7.3, 2.6.1.
CVE-2024-27918 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H).
How to Fix CVE-2024-27918
To remediate this vulnerability, upgrade all affected Github.com/coder/coder/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/coder/coder/v2 to 2.8.4
Upgrade github.com/coder/coder/v2 to 2.7.3
Upgrade github.com/coder/coder/v2 to 2.6.1
Upgrade github.com/coder/coder to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/coder/coder/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-27918, inspect your project dependencies for Github.com/coder/coder/v2:
inspect dependencies for github.com/coder/coder/v2
Analyze the terminal output to locate any version of Github.com/coder/coder/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/coder/coder/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-27918 Affected Github.com/coder/coder/v2 Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/coder/coder/v2
|
Go |
≥ 2.8.0
< 2.8.4
|
2.8.4
|
|
github.com/coder/coder/v2
|
Go |
≥ 2.7.0
< 2.7.3
|
2.7.3
|
|
github.com/coder/coder/v2
|
Go |
< 2.6.1
|
2.6.1
|
|
github.com/coder/coder
|
Go |
≤ 0.27.3
|
|
References
Frequently Asked Questions
What is CVE-2024-27918?
Which Github.com/coder/coder/v2 versions are affected?
What version fixes CVE-2024-27918?
Is github.com/coder/coder/v2 affected?
Is github.com/coder/coder affected?
What is the CVSS score of CVE-2024-27918?
What CWE is associated with CVE-2024-27918?
How can I check Go dependencies for CVE-2024-27918?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7cc2-r658-7xpf",
"modified" : "2024-03-21T18:29:31Z",
"published" : "2024-03-04T20:45:36Z",
"aliases" : [ "CVE-2024-27918" ],
"summary" : "Coder's OIDC authentication allows email with partially matching domain to register",
"details" : "### Summary\nA 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`).\n\n### Details\nDuring 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 (e.g. `user@exploitcorp.com` would match the allowed domain `corp.com`).\n\nAn attacker could register a domain name that exploited this vulnerability and register on a Coder instance with a public OIDC provider.\n\n### Impact\nCoder instances with OIDC enabled and protected by the `CODER_OIDC_EMAIL_DOMAIN` configuration.\n\nCoder 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.\n\nPublic OIDC providers (such as `google.com` without permitted domains set on the OAuth2 App) are impacted.\n\nGitHub authentication and external authentication are not impacted.\n\n### Was my deployment impacted?\nTo check if your deployment was exploited:\n- View the audit log on your deployment for unexpected registered users (using the `action:register` filter)\n- Check the users list for unexpected users\n - 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`)\n\n### Patched Versions\nThis vulnerability is remedied in\n- v2.8.4\n- v2.7.3\n- v2.6.1\n\nAll 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.**\n\n### Thanks\n- https://github.com/arcz\n- https://www.trailofbits.com\n\n### References\nhttps://github.com/coder/coder/security/advisories/GHSA-7cc2-r658-7xpf\nhttps://github.com/coder/coder/commit/4439a920e454a82565e445e4376c669e3b89591c\nhttps://nvd.nist.gov/vuln/detail/CVE-2024-27918",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/coder/coder/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"fixed" : "2.8.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/coder/coder/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/coder/coder/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/coder/coder"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.27.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/coder/coder/security/advisories/GHSA-7cc2-r658-7xpf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27918"
}, {
"type" : "WEB",
"url" : "https://github.com/coder/coder/commit/1171ce7add017481d28441575024209ac160ecb0"
}, {
"type" : "WEB",
"url" : "https://github.com/coder/coder/commit/2ba84911f8b02605e5958d5e4a2fe3979ec50b31"
}, {
"type" : "WEB",
"url" : "https://github.com/coder/coder/commit/2d37eb42e7db656e343fe1f36de5ab1a1a62f4fb"
}, {
"type" : "WEB",
"url" : "https://github.com/coder/coder/commit/4439a920e454a82565e445e4376c669e3b89591c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/coder/coder"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-04T20:45:36Z",
"nvd_published_at" : "2024-03-21T02:52:20Z"
}
}