The vulnerability stems from improper path handling in the plugin asset serving endpoint. Analysis of the security patch (commit c798c0e) shows the fix involved: 1) Adding path normalization with filepath.Rel() after prepending a slash, 2) Using absolute paths for plugin directories, and 3) Strict path containment checks. The original implementation in getPluginAssets concatenated user-controlled path parameters directly with plugin directories without sufficient validation, making it vulnerable to ../ style traversal attacks. The function's role in handling /public/plugins/ routes matches the vulnerability description's attack vector.
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 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 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. 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
We maintain a security category on our blog, where we will always post a summary, remediation, and mitigation details for any patch containing security fixes.