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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | grafana | 7.5.11-3.el8_6 | ALSA-2022:5717 |
| AlmaLinux:9 | grafana | 7.5.11-5.el9_0 | ALSA-2022:5716 |
| Alpine:v3.20 | grafana | 9.0.3-r0 | ALPINE-CVE-2022-31107 |
| Alpine:v3.21 | grafana | 9.0.3-r0 | ALPINE-CVE-2022-31107 |
| Alpine:v3.22 | grafana | 9.0.3-r0 | ALPINE-CVE-2022-31107 |
| Alpine:v3.23 | grafana | 9.0.3-r0 | ALPINE-CVE-2022-31107 |
| Alpine:v3.24 | grafana | 9.0.3-r0 | ALPINE-CVE-2022-31107 |
| Go | github.com/grafana/grafana | no fix listed | GO-2024-2852 |
| Go | github.com/grafana/grafana | 8.5.9 | GHSA-mx47-6497-3fv2 |
| Go | github.com/grafana/grafana | 9.0.3 | GHSA-mx47-6497-3fv2 |
| Go | github.com/grafana/grafana | 8.3.10 | GHSA-mx47-6497-3fv2 |
| Go | github.com/grafana/grafana | 8.4.10 | GHSA-mx47-6497-3fv2 |
| Rocky Linux:8 | grafana | 0:7.5.11-3.el8_6 | RLSA-2022:5717 |
| Rocky Linux:9 | grafana | 0:7.5.11-5.el9_0 | RLSA-2022:5716 |
Affected products (as reported)
Weakness: CWE-863 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L
References
- https://grafana.com/docs/grafana/next/release-notes/release-notes-8-4-10/ x_refsource_MISC
- https://github.com/grafana/grafana/security/advisories/GHSA-mx47-6497-3fv2 x_refsource_CONFIRM
- https://grafana.com/docs/grafana/next/release-notes/release-notes-8-5-9/ x_refsource_MISC
- https://grafana.com/docs/grafana/next/release-notes/release-notes-9-0-3/ x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20220901-0010/ x_refsource_CONFIRM