CVE-2023-49097: Github.com/zitadel/zitadel ZITADEL Account Takeover Vulnerability

HIGH
Advisory Identifier: GHSA-2wmj-46rj-qm2w
CVSS 8.1
CWE-640
Published
Advisory Summary

CVE-2023-49097 is a HIGH (CVSS 8.1) zitadel account takeover vulnerability (CWE-640: Weak Password Recovery Mechanism for Forgotten Password) affecting Github.com/zitadel/zitadel libraries in the Go ecosystem. The issue involves zitadel account takeover via malicious host header injection. Remediation is available by upgrading affected packages to version 2.39.9, 2.40.10, 2.41.6.

CVE-2023-49097 at a Glance

CVE Identifier CVE-2023-49097
GHSA Identifier GHSA-2wmj-46rj-qm2w
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-640: Weak Password Recovery Mechanism for Forgotten Password
Affected Product Github.com/zitadel/zitadel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

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:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2023-49097

To remediate this vulnerability, upgrade all affected Github.com/zitadel/zitadel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/zitadel/zitadel fixed: 2.39.9
Upgrade github.com/zitadel/zitadel to 2.39.9
github.com/zitadel/zitadel fixed: 2.40.10
Upgrade github.com/zitadel/zitadel to 2.40.10
github.com/zitadel/zitadel fixed: 2.41.6
Upgrade github.com/zitadel/zitadel to 2.41.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/zitadel/zitadel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-49097, inspect your project dependencies for Github.com/zitadel/zitadel:

inspect dependencies for github.com/zitadel/zitadel

Analyze the terminal output to locate any version of Github.com/zitadel/zitadel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.39.9), 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-640: Weak Password Recovery Mechanism for Forgotten Password, where the product contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak. In Github.com/zitadel/zitadel, 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

### Impact ZITADEL uses the notification triggering requests Forwarded or X-Forwarded-Host header to build the button link sent in emails for confirming a password reset with the emailed code. If this header is overwritten and a user clicks the link to a malicious site in the email, the secret code can be retrieved and used to reset the users password and take over his account. Accounts with MFA or Passwordless enabled can not be taken over by this attack. ### Patches The patched ZITADEL versions verify, that the auth requests instance is retrieved by the requests original domain (from the Forwarded or X-Forwarded-Host headers if available). If the instance can't be found using the original host or the auth request can't be found within that instance, ZITADEL throws an error. 2.x versions are fixed on >= [2.41.6](https://github.com/zitadel/zitadel/releases/tag/v2.41.6) 2.40.x versions are fixed on >= [2.40.10](https://github.com/zitadel/zitadel/releases/tag/v2.40.10) 2.39.x versions are fixed on >= [2.39.9](https://github.com/zitadel/zitadel/releases/tag/v2.39.9) The vulnerablility was introduced with 2.39.0. ### Workarounds A ZITADEL fronting proxy can be configured to delete all Forwarded and X-Forwarded-Host header values before sending requests to ZITADEL self-hosted environments. ### References None ### Questions If you have any questions or comments about this advisory, please email us at [security@zitadel.com](mailto:security@zitadel.com)

CVE-2023-49097 Affected Github.com/zitadel/zitadel Versions

3 component(s)
Fixed Versions:
2.39.92.40.102.41.6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/zitadel/zitadel
Go
≥ 2.39.0
< 2.39.9
2.39.9
github.com/zitadel/zitadel
Go
≥ 2.40.0
< 2.40.10
2.40.10
github.com/zitadel/zitadel
Go
≥ 2.41.0
< 2.41.6
2.41.6

References

Frequently Asked Questions

What is CVE-2023-49097?
CVE-2023-49097 is a security vulnerability in Github.com/zitadel/zitadel involving ZITADEL Account Takeover via Malicious Host Header Injection under CWE-640: Weak Password Recovery Mechanism for Forgotten Password.
Which Github.com/zitadel/zitadel versions are affected?
Affected versions include releases prior to 2.39.9, 2.40.10, 2.41.6 across affected packages: github.com/zitadel/zitadel.
What version fixes CVE-2023-49097?
Upgrading to 2.39.9, 2.40.10, 2.41.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/zitadel/zitadel affected?
Yes, github.com/zitadel/zitadel is affected in releases prior to 2.39.9, 2.40.10, 2.41.6. Upgrade your dependency to 2.39.9, 2.40.10, 2.41.6 or later.
What is the CVSS score of CVE-2023-49097?
CVE-2023-49097 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-49097?
CVE-2023-49097 is classified under CWE-640: Weak Password Recovery Mechanism for Forgotten Password (The product contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.).
How can I check Go dependencies for CVE-2023-49097?
Run the dependency tree command: 'inspect dependencies for github.com/zitadel/zitadel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2wmj-46rj-qm2w",
  "modified" : "2023-11-30T15:03:20Z",
  "published" : "2023-11-29T21:32:51Z",
  "aliases" : [ "CVE-2023-49097" ],
  "summary" : "ZITADEL Account Takeover via Malicious Host Header Injection",
  "details" : "### Impact\n\nZITADEL uses the notification triggering requests Forwarded or X-Forwarded-Host header to build the button link sent in emails for confirming a password reset with the emailed code. If this header is overwritten and a user clicks the link to a malicious site in the email, the secret code can be retrieved and used to reset the users password and take over his account.\n\nAccounts with MFA or Passwordless enabled can not be taken over by this attack.\n\n### Patches\n\nThe patched ZITADEL versions verify, that the auth requests instance is retrieved by the requests original domain (from the Forwarded or X-Forwarded-Host headers if available). If the instance can't be found using the original host or the auth request can't be found within that instance, ZITADEL throws an error.\n\n2.x versions are fixed on >= [2.41.6](https://github.com/zitadel/zitadel/releases/tag/v2.41.6)\n2.40.x versions are fixed on >= [2.40.10](https://github.com/zitadel/zitadel/releases/tag/v2.40.10)\n2.39.x versions are fixed on >= [2.39.9](https://github.com/zitadel/zitadel/releases/tag/v2.39.9)\n\nThe vulnerablility was introduced with 2.39.0.\n\n### Workarounds\n\nA ZITADEL fronting proxy can be configured to delete all Forwarded and X-Forwarded-Host header values before sending requests to ZITADEL self-hosted environments.\n\n### References\n\nNone\n\n### Questions\n\nIf you have any questions or comments about this advisory, please email us at [security@zitadel.com](mailto:security@zitadel.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/zitadel/zitadel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.39.0"
      }, {
        "fixed" : "2.39.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/zitadel/zitadel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.40.0"
      }, {
        "fixed" : "2.40.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/zitadel/zitadel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.41.0"
      }, {
        "fixed" : "2.41.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zitadel/zitadel/security/advisories/GHSA-2wmj-46rj-qm2w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49097"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zitadel/zitadel"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-640" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-29T21:32:51Z",
    "nvd_published_at" : "2023-11-30T05:15:09Z"
  }
}