GHSA-7CC2-R658-7XPF

Vulnerability from github – Published: 2024-03-04 20:45 – Updated: 2024-03-21 18:29
VLAI?
Summary
Coder's OIDC authentication allows email with partially matching domain to register
Details

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

  • 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

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/coder/coder/v2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.8.0"
            },
            {
              "fixed": "2.8.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/coder/coder/v2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.7.0"
            },
            {
              "fixed": "2.7.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/coder/coder/v2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.6.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/coder/coder"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "0.27.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-27918"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-03-04T20:45:36Z",
    "nvd_published_at": "2024-03-21T02:52:20Z",
    "severity": "HIGH"
  },
  "details": "### Summary\nA vulnerability in Coder\u0027s 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\u0027s 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\u2019t 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",
  "id": "GHSA-7cc2-r658-7xpf",
  "modified": "2024-03-21T18:29:31Z",
  "published": "2024-03-04T20:45:36Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Coder\u0027s OIDC authentication allows email with partially matching domain to register"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…