Vulnerability · Published Jul 15, 2022 · Assigned by GitHub_M

CVE-2022-31107Grafana account takeover via OAuth vulnerability

High 7.1

In plain English

A high-severity incorrect authorization in grafana from grafana. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.9% (higher than 87% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.1High
Exploit odds (30 days)2.9%top 13.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8grafana7.5.11-3.el8_6ALSA-2022:5717
AlmaLinux:9grafana7.5.11-5.el9_0ALSA-2022:5716
Alpine:v3.20grafana9.0.3-r0ALPINE-CVE-2022-31107
Alpine:v3.21grafana9.0.3-r0ALPINE-CVE-2022-31107
Alpine:v3.22grafana9.0.3-r0ALPINE-CVE-2022-31107
Alpine:v3.23grafana9.0.3-r0ALPINE-CVE-2022-31107
Alpine:v3.24grafana9.0.3-r0ALPINE-CVE-2022-31107
Gogithub.com/grafana/grafanano fix listedGO-2024-2852
Gogithub.com/grafana/grafana8.5.9GHSA-mx47-6497-3fv2
Gogithub.com/grafana/grafana9.0.3GHSA-mx47-6497-3fv2
Gogithub.com/grafana/grafana8.3.10GHSA-mx47-6497-3fv2
Gogithub.com/grafana/grafana8.4.10GHSA-mx47-6497-3fv2
Rocky Linux:8grafana0:7.5.11-3.el8_6RLSA-2022:5717
Rocky Linux:9grafana0:7.5.11-5.el9_0RLSA-2022:5716

Affected products (as reported)

VendorProductVersions
grafana grafana >= 5.3, < 8.3.10>= 8.4.0, < 8.4.10>= 8.5.0, < 8.5.9>= 9.0.0, < 9.0.3

Weakness: CWE-863 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L

References