CVE-2021-43798: Github.com/grafana/grafana Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-8pjx-jj86-j47p
CVSS 7.5
CWE-22
Published
Advisory Summary

CVE-2021-43798 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/grafana/grafana libraries in the Go ecosystem. The issue involves grafana path traversal. Remediation is available by upgrading affected packages to version 8.3.1, 8.2.7, 8.1.8, 8.0.7.

CVE-2021-43798 at a Glance

CVE Identifier CVE-2021-43798
GHSA Identifier GHSA-8pjx-jj86-j47p
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/grafana/grafana
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-43798

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: 8.3.1
Upgrade github.com/grafana/grafana to 8.3.1
github.com/grafana/grafana fixed: 8.2.7
Upgrade github.com/grafana/grafana to 8.2.7
github.com/grafana/grafana fixed: 8.1.8
Upgrade github.com/grafana/grafana to 8.1.8
github.com/grafana/grafana fixed: 8.0.7
Upgrade github.com/grafana/grafana to 8.0.7
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-2021-43798, 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 8.3.1), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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.1, 8.2.7, 8.1.8, 8.0.7. This patch release includes a high severity security fix that affects Grafana versions from v8.0.0-beta1 through v8.3.0. Release v8.3.1, only containing a security fix: - [Download Grafana 8.3.1](https://grafana.com/grafana/download/8.3.1) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-3-1/) Release v8.2.7, only containing a security fix: - [Download Grafana 8.2.7](https://grafana.com/grafana/download/8.2.7) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-2-7/) Release v8.1.8, only containing a security fix: - [Download Grafana 8.1.8](https://grafana.com/grafana/download/8.1.8) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-1-8/) Release v8.0.7, only containing a security fix: - [Download Grafana 8.0.7](https://grafana.com/grafana/download/8.0.7) - [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-0-7/) ## Path Traversal ([CVE-2021-43798](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43798)) ### Summary On 2021-12-03, we received a report that Grafana is vulnerable to directory traversal, allowing access to local files. We have confirmed this for versions 8.0.0-beta1 to 8.3.0. Thanks to our defense-in-depth approach, at no time has [Grafana Cloud](https://grafana.com/cloud) been vulnerable. The vulnerable URL path is: <grafana_host_url>/public/plugins/<plugin-id>/, where <plugin-id> is the plugin ID for any installed plugin. Every Grafana instance comes with pre-installed plugins like the Prometheus plugin or MySQL plugin so the following URLs are vulnerable for every instance: * <grafana_host_url>/public/plugins/alertlist/ * <grafana_host_url>/public/plugins/annolist/ * <grafana_host_url>/public/plugins/barchart/ * <grafana_host_url>/public/plugins/bargauge/ * <grafana_host_url>/public/plugins/candlestick/ * <grafana_host_url>/public/plugins/cloudwatch/ * <grafana_host_url>/public/plugins/dashlist/ * <grafana_host_url>/public/plugins/elasticsearch/ * <grafana_host_url>/public/plugins/gauge/ * <grafana_host_url>/public/plugins/geomap/ * <grafana_host_url>/public/plugins/gettingstarted/ * <grafana_host_url>/public/plugins/grafana-azure-monitor-datasource/ * <grafana_host_url>/public/plugins/graph/ * <grafana_host_url>/public/plugins/heatmap/ * <grafana_host_url>/public/plugins/histogram/ * <grafana_host_url>/public/plugins/influxdb/ * <grafana_host_url>/public/plugins/jaeger/ * <grafana_host_url>/public/plugins/logs/ * <grafana_host_url>/public/plugins/loki/ * <grafana_host_url>/public/plugins/mssql/ * <grafana_host_url>/public/plugins/mysql/ * <grafana_host_url>/public/plugins/news/ * <grafana_host_url>/public/plugins/nodeGraph/ * <grafana_host_url>/public/plugins/opentsdb * <grafana_host_url>/public/plugins/piechart/ * <grafana_host_url>/public/plugins/pluginlist/ * <grafana_host_url>/public/plugins/postgres/ * <grafana_host_url>/public/plugins/prometheus/ * <grafana_host_url>/public/plugins/stackdriver/ * <grafana_host_url>/public/plugins/stat/ * <grafana_host_url>/public/plugins/state-timeline/ * <grafana_host_url>/public/plugins/status-history/ * <grafana_host_url>/public/plugins/table/ * <grafana_host_url>/public/plugins/table-old/ * <grafana_host_url>/public/plugins/tempo/ * <grafana_host_url>/public/plugins/testdata/ * <grafana_host_url>/public/plugins/text/ * <grafana_host_url>/public/plugins/timeseries/ * <grafana_host_url>/public/plugins/welcome/ * <grafana_host_url>/public/plugins/zipkin/ We have received CVE-2021-43798 for this issue. The CVSS score for this vulnerability is 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) for Grafana versions 8.0.0-beta1 to 8.3.0 ### Affected versions with high severity Grafana 8.0.0-beta1 to 8.3.0 ### Solutions and mitigations All installations between v8.0.0-beta1 and v8.3.0 should be upgraded as soon as possible. If you can not upgrade, running a reverse proxy in front of Grafana that normalizes the PATH of the request will mitigate the vulnerability. For example the normalize_path setting in envoy. Thanks to our defense-in-depth approach, [Grafana Cloud](https://grafana.com/cloud) instances have not been affected by the vulnerability. 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. In alphabetical order, this is applicable to Amazon Managed Grafana, and Azure Managed Grafana. ### Timeline and postmortem Here is a detailed timeline starting from when we originally learned of the issue. All times in UTC. * 2021-12-03: Security researcher sends the initial report * 2021-12-03: Confirmed for 8.0.0-beta1 through 8.3.0 * 2021-12-03: Confirmed that Grafana Cloud is not vulnerable * 2021-12-03: Security fix determined and committed to Git * 2021-12-03: Release timeline determined: 2021-12-07 for private customer release, 2021-12-14 for public release * 2021-12-06: Second report about the vulnerability received * 2021-12-07: We received information that the vulnerability has been leaked to the public, turning it into a 0 day * 2021-12-07: Decision made to release as quickly as feasible * 2021-12-07: Private release with reduced two hour grace period instead of the usual 1 week * 2021-12-07: Public release ### Acknowledgements We would like to thank [Jordy Versmissen](https://twitter.com/j0v0x0) for finding the vulnerability and alerting us to it. ## Reporting security Issues If you think you have found a security vulnerability, please send a report to [security@grafana.com](mailto: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](https://keyserver.ubuntu.com/pks/lookup?search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA&fingerprint=on&op=index). ## Security announcements We maintain a [security category on our blog](https://grafana.com/tags/security/), 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-2021-43798 Affected Github.com/grafana/grafana Versions

4 component(s)
Fixed Versions:
8.3.18.2.78.1.88.0.7
Product / Package Ecosystem Affected Versions Fixed Version
github.com/grafana/grafana
Go
≥ 8.3.0
< 8.3.1
8.3.1
github.com/grafana/grafana
Go
≥ 8.2.0
< 8.2.7
8.2.7
github.com/grafana/grafana
Go
≥ 8.1.0
< 8.1.8
8.1.8
github.com/grafana/grafana
Go
≥ 8.0.0-beta1
< 8.0.7
8.0.7

References

Frequently Asked Questions

What is CVE-2021-43798?
CVE-2021-43798 is a security vulnerability in Github.com/grafana/grafana involving Grafana path traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/grafana/grafana versions are affected?
Affected versions include releases prior to 8.3.1, 8.2.7, 8.1.8, 8.0.7 across affected packages: github.com/grafana/grafana.
What version fixes CVE-2021-43798?
Upgrading to 8.3.1, 8.2.7, 8.1.8, 8.0.7 (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 8.3.1, 8.2.7, 8.1.8, 8.0.7. Upgrade your dependency to 8.3.1, 8.2.7, 8.1.8, 8.0.7 or later.
What is the CVSS score of CVE-2021-43798?
CVE-2021-43798 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:H.
What CWE is associated with CVE-2021-43798?
CVE-2021-43798 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2021-43798?
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-8pjx-jj86-j47p",
  "modified" : "2025-10-22T19:08:39Z",
  "published" : "2024-02-01T00:16:10Z",
  "aliases" : [ "CVE-2021-43798" ],
  "summary" : "Grafana path traversal",
  "details" : "Today we are releasing Grafana 8.3.1, 8.2.7, 8.1.8, 8.0.7. This patch release includes a high severity security fix that affects Grafana versions from v8.0.0-beta1 through v8.3.0.\n\nRelease v8.3.1, only containing a security fix:\n\n- [Download Grafana 8.3.1](https://grafana.com/grafana/download/8.3.1)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-3-1/)\n\nRelease v8.2.7, only containing a security fix:\n\n- [Download Grafana 8.2.7](https://grafana.com/grafana/download/8.2.7)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-2-7/)\n\nRelease v8.1.8, only containing a security fix:\n\n- [Download Grafana 8.1.8](https://grafana.com/grafana/download/8.1.8)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-1-8/)\n\nRelease v8.0.7, only containing a security fix:\n\n- [Download Grafana 8.0.7](https://grafana.com/grafana/download/8.0.7)\n- [Release notes](https://grafana.com/docs/grafana/latest/release-notes/release-notes-8-0-7/)\n\n\n## Path Traversal ([CVE-2021-43798](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43798))\n\n### Summary \n\nOn 2021-12-03, we received a report that Grafana is vulnerable to directory traversal, allowing access to local files. We have confirmed this for versions 8.0.0-beta1 to 8.3.0. Thanks to our defense-in-depth approach, at no time has [Grafana Cloud](https://grafana.com/cloud) been vulnerable.\n\nThe vulnerable URL path is: <grafana_host_url>/public/plugins/<plugin-id>/, where <plugin-id> is the plugin ID for any installed plugin.\n\nEvery Grafana instance comes with pre-installed plugins like the Prometheus plugin or MySQL plugin so the following URLs are vulnerable for every instance:\n\n* <grafana_host_url>/public/plugins/alertlist/\n* <grafana_host_url>/public/plugins/annolist/\n* <grafana_host_url>/public/plugins/barchart/\n* <grafana_host_url>/public/plugins/bargauge/\n* <grafana_host_url>/public/plugins/candlestick/\n* <grafana_host_url>/public/plugins/cloudwatch/\n* <grafana_host_url>/public/plugins/dashlist/\n* <grafana_host_url>/public/plugins/elasticsearch/\n* <grafana_host_url>/public/plugins/gauge/\n* <grafana_host_url>/public/plugins/geomap/\n* <grafana_host_url>/public/plugins/gettingstarted/\n* <grafana_host_url>/public/plugins/grafana-azure-monitor-datasource/\n* <grafana_host_url>/public/plugins/graph/\n* <grafana_host_url>/public/plugins/heatmap/\n* <grafana_host_url>/public/plugins/histogram/\n* <grafana_host_url>/public/plugins/influxdb/\n* <grafana_host_url>/public/plugins/jaeger/\n* <grafana_host_url>/public/plugins/logs/\n* <grafana_host_url>/public/plugins/loki/\n* <grafana_host_url>/public/plugins/mssql/\n* <grafana_host_url>/public/plugins/mysql/\n* <grafana_host_url>/public/plugins/news/\n* <grafana_host_url>/public/plugins/nodeGraph/\n* <grafana_host_url>/public/plugins/opentsdb\n* <grafana_host_url>/public/plugins/piechart/\n* <grafana_host_url>/public/plugins/pluginlist/\n* <grafana_host_url>/public/plugins/postgres/\n* <grafana_host_url>/public/plugins/prometheus/\n* <grafana_host_url>/public/plugins/stackdriver/\n* <grafana_host_url>/public/plugins/stat/\n* <grafana_host_url>/public/plugins/state-timeline/\n* <grafana_host_url>/public/plugins/status-history/\n* <grafana_host_url>/public/plugins/table/\n* <grafana_host_url>/public/plugins/table-old/\n* <grafana_host_url>/public/plugins/tempo/\n* <grafana_host_url>/public/plugins/testdata/\n* <grafana_host_url>/public/plugins/text/\n* <grafana_host_url>/public/plugins/timeseries/\n* <grafana_host_url>/public/plugins/welcome/\n* <grafana_host_url>/public/plugins/zipkin/\n\nWe have received CVE-2021-43798 for this issue. The CVSS score for this vulnerability is 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) for Grafana versions 8.0.0-beta1 to 8.3.0 \n\n### Affected versions with high severity \n\nGrafana 8.0.0-beta1 to 8.3.0\n\n### Solutions and mitigations\n\nAll installations between v8.0.0-beta1 and v8.3.0 should be upgraded as soon as possible.\n\nIf you can not upgrade, running a reverse proxy in front of Grafana that normalizes the PATH of the request will mitigate the vulnerability. For example the normalize_path setting in envoy.\n\nThanks to our defense-in-depth approach, [Grafana Cloud](https://grafana.com/cloud) instances have not been affected by the vulnerability.\n\nAs 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. In alphabetical order, this is applicable to Amazon Managed Grafana, and Azure 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* 2021-12-03: Security researcher sends the initial report\n* 2021-12-03: Confirmed for 8.0.0-beta1 through 8.3.0\n* 2021-12-03: Confirmed that Grafana Cloud is not vulnerable\n* 2021-12-03: Security fix determined and committed to Git\n* 2021-12-03: Release timeline determined: 2021-12-07 for private customer release, 2021-12-14 for public release\n* 2021-12-06: Second report about the vulnerability received\n* 2021-12-07: We received information that the vulnerability has been leaked to the public, turning it into a 0 day\n* 2021-12-07: Decision made to release as quickly as feasible\n* 2021-12-07: Private release with reduced two hour grace period instead of the usual 1 week\n* 2021-12-07: Public release\n\n### Acknowledgements\n\nWe would like to thank [Jordy Versmissen](https://twitter.com/j0v0x0) for finding the vulnerability and alerting us to it.\n\n## Reporting security Issues\n\nIf you think you have found a security vulnerability, please send a report to [security@grafana.com](mailto:security@grafana.com). This address can be used for all of\nGrafana 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](https://keyserver.ubuntu.com/pks/lookup?search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA&fingerprint=on&op=index).\n\n## Security announcements\n\nWe maintain a [security category on our blog](https://grafana.com/tags/security/), 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).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.0"
      }, {
        "fixed" : "8.3.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.2.0"
      }, {
        "fixed" : "8.2.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.1.0"
      }, {
        "fixed" : "8.1.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/grafana"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0-beta1"
      }, {
        "fixed" : "8.0.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/grafana/grafana/security/advisories/GHSA-8pjx-jj86-j47p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43798"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grafana/grafana/commit/c798c0e958d15d9cc7f27c72113d572fa58545ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grafana/grafana"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/blog/2021/12/08/an-update-on-0day-cve-2021-43798-grafana-directory-traversal"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20211229-0004"
  }, {
    "type" : "WEB",
    "url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-43798"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/165198/Grafana-Arbitrary-File-Reading.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/165221/Grafana-8.3.0-Directory-Traversal-Arbitrary-File-Read.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2021/12/09/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2021/12/10/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-01T00:16:10Z",
    "nvd_published_at" : "2021-12-07T19:15:00Z"
  }
}