CVE-2022-21713: Github.com/grafana/grafana Grafana API IDOR Vulnerability

MODERATE
Advisory Identifier: GHSA-63g3-9jq3-mccv
CVSS 4.3
CWE-639 CWE-863
Published
Advisory Summary

CVE-2022-21713 is a MODERATE (CVSS 4.3) grafana api idor vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Github.com/grafana/grafana libraries in the Go ecosystem. The issue involves grafana api idor. Remediation is available by upgrading affected packages to version 7.5.15, 8.3.5.

CVE-2022-21713 at a Glance

CVE Identifier CVE-2022-21713
GHSA Identifier GHSA-63g3-9jq3-mccv
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Github.com/grafana/grafana
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

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:L/I:N/A:N).

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 Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-21713

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: 7.5.15
Upgrade github.com/grafana/grafana to 7.5.15
github.com/grafana/grafana fixed: 8.3.5
Upgrade github.com/grafana/grafana to 8.3.5
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-2022-21713, 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 7.5.15), 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-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. 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

Today we are releasing Grafana 8.3.5 and 7.5.14. This patch release includes MEDIUM severity security fix for Grafana Teams API IDOR. Release v.8.3.5, only containing security fixes: - [Download Grafana 8.3.5](https://grafana.com/grafana/download/8.3.5) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-3-5/) Release v.7.5.15, only containing security fixes: - [Download Grafana 7.5.15](https://grafana.com/grafana/download/7.5.15) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-7-5-15/) ## Teams API IDOR([CVE-2022-21713](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21713)) On Jan. 18, an external security researcher, Kürşad ALSAN from [NSPECT.IO](https://www.nspect.io) ([@nspectio](https://twitter.com/nspectio) on Twitter), contacted Grafana to disclose an IDOR (Insecure Direct Object Reference) vulnerability on Grafana Teams APIs. We believe that this vulnerability is rated at CVSS 4.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N). ### Impact This vulnerability only impacts the following API endpoints: - `/teams/:teamId` - an authenticated attacker can view unintended data by querying for the specific team ID. - `/teams/:search` - an authenticated attacker can search for teams and see the total number of available teams, including for those teams that the user does not have access to. - `/teams/:teamId/members` - when editors_can_admin flag is enabled, an authenticated attacker can see unintended data by querying for the specific team ID. ### Affected versions with MEDIUM severity All Grafana >=5.0.0-beta1 versions are affected by this vulnerability. ### Solutions and mitigations All installations after Grafana v5.0.0-beta1 should be upgraded as soon as possible. Appropriate patches have been applied to [Grafana Cloud](https://grafana.com/cloud) and as always, we closely coordinated with all cloud providers licensed to offer Grafana Pro. They have received early notification under embargo and confirmed that their offerings are secure at the time of this announcement. This is applicable to Amazon Managed Grafana. ### Timeline and postmortem Here is a detailed timeline starting from when we originally learned of the issue. All times in UTC. - 2022-01-18 05:000 Issue submitted by external researcher - 2022-01-21 17:45 Issue escalated and the vulnerability confirmed reproducible - 2022-01-24 13:37 CVE requested - 2022-01-24 14:40 Private release planned for 2022-01-25, and public release planned for 2022-02-01. - 2022-01-24 17:00 PR with fix opened - 2022-01-24 19:00 GitHub has issued CVE-2022-21713 - 2022-01-25 12:00 Private release - 2022-02-01 12:00 During public release process, we realized that private 7.x release was incomplete. Abort public release, send second private release to customers using 7.x - 2022-02-08 13:00 Public release ### Acknowledgements We would like to thank Kürşad ALSAN from [NSPECT.IO](https://www.nspect.io) ([@nspectio](https://twitter.com/nspectio) on Twitter) for responsibly disclosing the vulnerability. ### Reporting security issues If you think you have found a security vulnerability, please send a report to security@grafana.com. This address can be used for all of Grafana Labs' open source and commercial products (including, but not limited to Grafana, Grafana Cloud, Grafana Enterprise, and grafana.com). We can accept only vulnerability reports at this address. We would prefer that you encrypt your message to us by using our PGP key. The key fingerprint is F988 7BEA 027A 049F AE8E 5CAA D125 8932 BE24 C5CA The key is available from keyserver.ubuntu.com. ### Security announcements We maintain a [security category](https://community.grafana.com/c/support/security-announcements) on our blog, where we will always post a summary, remediation, and mitigation details for any patch containing security fixes. You can also subscribe to our [RSS feed](https://grafana.com/tags/security/index.xml).

CVE-2022-21713 Affected Github.com/grafana/grafana Versions

2 component(s)
Fixed Versions:
7.5.158.3.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/grafana/grafana
Go
≥ 5.0.0-beta1
< 7.5.15
7.5.15
github.com/grafana/grafana
Go
≥ 8.0.0
< 8.3.5
8.3.5

References

Frequently Asked Questions

What is CVE-2022-21713?
CVE-2022-21713 is a security vulnerability in Github.com/grafana/grafana involving Grafana API IDOR under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Github.com/grafana/grafana versions are affected?
Affected versions include releases prior to 7.5.15, 8.3.5 across affected packages: github.com/grafana/grafana.
What version fixes CVE-2022-21713?
Upgrading to 7.5.15, 8.3.5 (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 7.5.15, 8.3.5. Upgrade your dependency to 7.5.15, 8.3.5 or later.
What is the CVSS score of CVE-2022-21713?
CVE-2022-21713 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2022-21713?
CVE-2022-21713 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check Go dependencies for CVE-2022-21713?
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-63g3-9jq3-mccv",
  "modified" : "2024-05-14T22:17:23Z",
  "published" : "2024-05-14T22:17:22Z",
  "aliases" : [ "CVE-2022-21713" ],
  "summary" : "Grafana API IDOR",
  "details" : "Today we are releasing Grafana 8.3.5 and 7.5.14. This patch release includes MEDIUM severity security fix for Grafana Teams API IDOR.\n\nRelease v.8.3.5, only containing security fixes:\n\n- [Download Grafana 8.3.5](https://grafana.com/grafana/download/8.3.5)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-3-5/)\n\nRelease v.7.5.15, only containing security fixes:\n\n- [Download Grafana 7.5.15](https://grafana.com/grafana/download/7.5.15)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-7-5-15/)\n\n## Teams API IDOR([CVE-2022-21713](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21713))\n\nOn Jan. 18, an external security researcher, Kürşad ALSAN from [NSPECT.IO](https://www.nspect.io) ([@nspectio](https://twitter.com/nspectio) on Twitter), contacted Grafana to disclose an IDOR (Insecure Direct Object Reference) vulnerability on Grafana Teams APIs.\n\nWe believe that this vulnerability is rated at CVSS 4.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).  \n\n### Impact\n\nThis vulnerability only impacts the following API endpoints:\n\n- `/teams/:teamId` - an authenticated attacker can view unintended data by querying for the specific team ID.\n- `/teams/:search` - an authenticated attacker can search for teams and see the total number of available teams, including for those teams that the user does not have access to.\n- `/teams/:teamId/members` - when editors_can_admin flag is enabled, an authenticated attacker can see unintended data by querying for the specific team ID.\n\n### Affected versions with MEDIUM severity \nAll Grafana >=5.0.0-beta1 versions are affected by this vulnerability.\n\n### Solutions and mitigations\n\nAll installations after Grafana v5.0.0-beta1 should be upgraded as soon as possible.\n\nAppropriate patches have been applied to [Grafana Cloud](https://grafana.com/cloud) and as always, we closely coordinated with all cloud providers licensed to offer Grafana Pro. They have received early notification under embargo and confirmed that their offerings are secure at the time of this announcement. This is applicable to Amazon Managed Grafana.\n\n### Timeline and postmortem\n\nHere is a detailed timeline starting from when we originally learned of the issue. All times in UTC.\n\n- 2022-01-18 05:000 Issue submitted by external researcher\n- 2022-01-21 17:45 Issue escalated and the vulnerability confirmed reproducible\n- 2022-01-24 13:37 CVE requested\n- 2022-01-24 14:40 Private release planned for 2022-01-25, and public release planned for 2022-02-01.\n- 2022-01-24 17:00 PR with fix opened\n- 2022-01-24 19:00 GitHub has issued CVE-2022-21713 \n- 2022-01-25 12:00 Private release\n- 2022-02-01 12:00 During public release process, we realized that private 7.x release was incomplete. Abort public release, send second private release to customers using 7.x\n- 2022-02-08 13:00 Public release\n\n### Acknowledgements\nWe would like to thank Kürşad ALSAN from [NSPECT.IO](https://www.nspect.io) ([@nspectio](https://twitter.com/nspectio) on Twitter) for responsibly disclosing the vulnerability.\n\n### Reporting security issues\n\nIf you think you have found a security vulnerability, please send a report to security@grafana.com. This address can be used for all of Grafana Labs' open source and commercial products (including, but not limited to Grafana, Grafana Cloud, Grafana Enterprise, and grafana.com). We can accept only vulnerability reports at this address. We would prefer that you encrypt your message to us by using our PGP key. The key fingerprint is\n\nF988 7BEA 027A 049F AE8E 5CAA D125 8932 BE24 C5CA\n\nThe key is available from keyserver.ubuntu.com.\n\n### Security announcements\n\nWe maintain a [security category](https://community.grafana.com/c/support/security-announcements) on our blog, where we will always post a summary, remediation, and mitigation details for any patch containing security fixes.\n\nYou can also subscribe to our [RSS feed](https://grafana.com/tags/security/index.xml).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-beta1"
      }, {
        "fixed" : "7.5.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.3.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/grafana/grafana/security/advisories/GHSA-63g3-9jq3-mccv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21713"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grafana/grafana/pull/45083"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grafana/grafana"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2PFW6Q2LXXWTFRTMTRN4ZGADFRQPKJ3D"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/36GUEPA5TPSC57DZTPYPBL6T7UPQ2FRH"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HLAQRRGNSO5MYCPAXGPH2OCSHOGHSQMQ"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220303-0005"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-14T22:17:22Z",
    "nvd_published_at" : "2022-02-08T21:15:20Z"
  }
}