Skip to content
Heist/ feed
Back to feed
High

Grafana account takeover via OAuth vulnerability

Type: advisorySources: OSV

Grafana is an open-source platform for monitoring and observability. In versions 5.3 until 9.0.3, 8.5.9, 8.4.10, and 8.3.10, it is possible for a malicious user who has authorization to log into a Grafana instance via a configured OAuth IdP which provides a login name to take over the account of another user in that Grafana instance. This can occur when the malicious user is authorized to log in to Grafana via OAuth, the malicious user's external user id is not already associated with an account in Grafana, the malicious user's email address is not already associated with an account in Grafana, and the malicious user knows the Grafana username of the target user. If these conditions are met, the malicious user can set their username in the OAuth provider to that of the target user, then go through the OAuth flow to log in to Grafana. Due to the way that external and internal user accounts are linked together during login, if the conditions above are all met then the malicious user will be able to log in to the target user's Grafana account. Versions 9.0.3, 8.5.9, 8.4.10, and 8.3.10 contain a patch for this issue. As a workaround, concerned users can disable OAuth login to their Grafana instance, or ensure that all users authorized to log in via OAuth have a corresponding user account in Grafana linked to their email address.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-31107
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 21:54 UTC · Revision 1

Source evidence

Grafana account takeover via OAuth vulnerability

core-osv · Original source

Published 15 Jul 2022, 12:30 UTC

Grafana is an open-source platform for monitoring and observability. In versions 5.3 until 9.0.3, 8.5.9, 8.4.10, and 8.3.10, it is possible for a malicious user who has authorization to log into a Grafana instance via a configured OAuth IdP which provides a login name to take over the account of another user in that Grafana instance. This can occur when the malicious user is authorized to log in to Grafana via OAuth, the malicious user's external user id is not already associated with an account in Grafana, the malicious user's email address is not already associated with an account in Grafana, and the malicious user knows the Grafana username of the target user. If these conditions are met, the malicious user can set their username in the OAuth provider to that of the target user, then go through the OAuth flow to log in to Grafana. Due to the way that external and internal user accounts are linked together during login, if the conditions above are all met then the malicious user will be able to log in to the target user's Grafana account. Versions 9.0.3, 8.5.9, 8.4.10, and 8.3.10 contain a patch for this issue. As a workaround, concerned users can disable OAuth login to their Grafana instance, or ensure that all users authorized to log in via OAuth have a corresponding user account in Grafana linked to their email address.

osv:CVE-2022-31107
Complete source record
{
  "id": "2311364a261c53bba37874f241fbf46ff439fd13b8a2f82cdd62418b18643740",
  "url": "https://osv.dev/vulnerability/CVE-2022-31107",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Grafana account takeover via OAuth vulnerability",
    "summary": "Grafana is an open-source platform for monitoring and observability. In versions 5.3 until 9.0.3, 8.5.9, 8.4.10, and 8.3.10, it is possible for a malicious user who has authorization to log into a Grafana instance via a configured OAuth IdP which provides a login name to take over the account of another user in that Grafana instance. This can occur when the malicious user is authorized to log in to Grafana via OAuth, the malicious user's external user id is not already associated with an account in Grafana, the malicious user's email address is not already associated with an account in Grafana, and the malicious user knows the Grafana username of the target user. If these conditions are met, the malicious user can set their username in the OAuth provider to that of the target user, then go through the OAuth flow to log in to Grafana. Due to the way that external and internal user accounts are linked together during login, if the conditions above are all met then the malicious user will be able to log in to the target user's Grafana account. Versions 9.0.3, 8.5.9, 8.4.10, and 8.3.10 contain a patch for this issue. As a workaround, concerned users can disable OAuth login to their Grafana instance, or ensure that all users authorized to log in via OAuth have a corresponding user account in Grafana linked to their email address.",
    "evidence": "osv:CVE-2022-31107",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-31107",
      "aliases": [
        "BIT-grafana-2022-31107",
        "CVE-2022-31107",
        "GHSA-mx47-6497-3fv2",
        "GO-2024-2852"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/grafana/grafana",
              "type": "GIT",
              "events": [
                {
                  "introduced": "c613a317a18b36ce1dafc24eeeb7b887c092a8a5"
                },
                {
                  "fixed": "1cf8d3e67c07450a04fe0a8513e6fbe21ae89ca6"
                },
                {
                  "introduced": "e6728d143480cc05d6f91eb740f91836399b8e6a"
                },
                {
                  "fixed": "0f5a1e53f03a0735e013e4f3fb7ec084865ef964"
                },
                {
                  "introduced": "6134e3cf35a99c7dd3041b7ececb47cb7619ba9a"
                },
                {
                  "fixed": "2955d0bc8acaa69edbc03c3efb5c1e4f1e9d84d9"
                },
                {
                  "introduced": "b5c56f63710e09f37b8557ddd8b99ae3fc583169"
                },
                {
                  "fixed": "023f9251a91743d2399fc32dcf5df8422759a8eb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:grafana:grafana:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "5.3.0"
                      },
                      {
                        "fixed": "8.3.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:grafana:grafana:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.4.0"
                      },
                      {
                        "fixed": "8.4.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:grafana:grafana:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.5.0"
                      },
                      {
                        "fixed": "8.5.9"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:grafana:grafana:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "9.0.0"
                      },
                      {
                        "fixed": "9.0.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-31107.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.050239969Z",
      "provider": "osv",
      "references": [
        "https://grafana.com/docs/grafana/next/release-notes/release-notes-8-4-10/",
        "https://grafana.com/docs/grafana/next/release-notes/release-notes-8-5-9/",
        "https://grafana.com/docs/grafana/next/release-notes/release-notes-9-0-3/",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31107.json",
        "https://github.com/grafana/grafana/security/advisories/GHSA-mx47-6497-3fv2",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-31107",
        "https://security.netapp.com/advisory/ntap-20220901-0010/"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-863"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31107.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-31107",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 490393,
  "published_at": "2022-07-15T12:30:14+00:00"
}