CVEfocus › CVE database › CVE-2022-31107

CVE-2022-31107Grafana account takeover via OAuth vulnerability

CVSS 7.1 HighEPSS 2.9% (higher than 87% of CVEs)Published 2022-07-15Updated 2026-01-28Assigner: GitHub_M

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.

CWE-863

What to do

Fixed builds are available from AlmaLinux, Alpine, Go, Red Hat, Rocky Linux: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

16Fixed
1Fix pending

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04grafanaFix pendingUBUNTU-CVE-2022-31107
Red Hat Enterprise Linux 9grafanaFixed0:7.5.11-5.el9_0RHSA-2022:5716
Red Hat Enterprise Linux 8grafanaFixed0:7.5.11-3.el8_6RHSA-2022:5717
AlmaLinux 9grafanaFixed7.5.11-5.el9_0ALSA-2022:5716
AlmaLinux 8grafanaFixed7.5.11-3.el8_6ALSA-2022:5717
Rocky Linux 9grafanaFixed0:7.5.11-5.el9_0RLSA-2022:5716
Rocky Linux 8grafanaFixed0:7.5.11-3.el8_6RLSA-2022:5717
Alpine Linux 3.24grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.23grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.22grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.21grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.20grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.19grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.18grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.17grafanaFixed9.0.3-r0ALPINE-CVE-2022-31107
Alpine Linux 3.16grafanaFixed8.5.9-r0ALPINE-CVE-2022-31107
Go librarygithub.com/grafana/grafanaFixed9.0.3GO-2024-2852

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.